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 db
    java.util.List<Course> getAllCourses()  
    java.util.Optional<Course> getCourseByName​(java.lang.String name)
    getCourseByName
    int getCoursesAmmount()  
    Course save​(Course course)
    save to db

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getCourseByName

      public java.util.Optional<Course> getCourseByName​(java.lang.String name)
      getCourseByName
      Parameters:
      name - name of course to be found
      Returns:
      Course By Name
    • getAllCourses

      public java.util.List<Course> getAllCourses()
      Returns:
      all courses from db
    • save

      public Course save​(Course course)
      save to db
      Parameters:
      course - which course you would like to save
      Returns:
      Course instance with id from db
    • delete

      public void delete​(Course course)
      delete course from db
      Parameters:
      course - which course you would like to delete
    • getCoursesAmmount

      public int getCoursesAmmount()
      Returns:
      ammount of courses in db