Java Reference
In-Depth Information
The
Category
POJO has a number of protected instance variables, each with correspond-
ing setters and getters that conform to JavaBeans naming conventions. Other than
name
and
modificationDate
, all the other properties have a specific role in domain mod-
eling and persistence. The
id
property is used to store a unique number to identify the
category. The
items
property holds all the items stored under a category and represents a
many-to-many relationship between items and categories. The
parentCategory
prop-
erty represents a self-referential many-to-one relationship between parent and child cat-
egories. The
subCategories
property maintains a one-to-many relationship between a
category and its subcategories.