Package com.plannaplan.services
Class CourseService
java.lang.Object
com.plannaplan.services.CourseService
@Service
public class CourseService
extends java.lang.Object
Service of CourseService which can get(Course By Name, All Courses, Courses
Ammount ), save, delete course.
-
Constructor Summary
Constructors Constructor Description CourseService()
-
Method Summary
Modifier and Type Method Description void
delete(Course course)
delete course from dbjava.util.List<Course>
getAllCourses()
java.util.Optional<Course>
getCourseByName(java.lang.String name)
getCourseByNameint
getCoursesAmmount()
Course
save(Course course)
save to db
-
Constructor Details
-
CourseService
public CourseService()
-
-
Method Details
-
getCourseByName
getCourseByName- Parameters:
name
- name of course to be found- Returns:
- Course By Name
-
getAllCourses
- Returns:
- all courses from db
-
save
save to db- Parameters:
course
- which course you would like to save- Returns:
- Course instance with id from db
-
delete
delete course from db- Parameters:
course
- which course you would like to delete
-
getCoursesAmmount
public int getCoursesAmmount()- Returns:
- ammount of courses in db
-