Class Category

java.lang.Object
org.codewithmagret.rest.category.Category

@Entity public class Category extends Object
Represents a category that courses can belong to. Each category can have multiple courses, but each course belongs to only one category. This entity is used to organize courses into different categories, making it easier for users to find and browse courses based on their interests.
  • Constructor Details

    • Category

      public Category()
      Default constructor required by JPA. Initializes a new instance of the Category class.
  • Method Details

    • getId

      public Long getId()
      Gets the unique identifier of the category.
      Returns:
      the ID of the category
    • setId

      public void setId(Long id)
      Sets the unique identifier of the category.
      Parameters:
      id - the ID to set for the category
    • getName

      public String getName()
      Gets the name of the category.
      Returns:
      the name of the category
    • setName

      public void setName(String name)
      Sets the name of the category.
      Parameters:
      name - the name to set for the category
    • getCourses

      public List<Course> getCourses()
      Gets the list of courses that belong to this category.
      Returns:
      the list of courses in this category
    • setCourses

      public void setCourses(List<Course> courses)
      Sets the list of courses that belong to this category.
      Parameters:
      courses - the list of courses to set for this category