Places one product in one category, forming the many to many link between products and the catalogue tree. A product is in a category only if one of these rows exists, so a product in three categories has three rows and removing it from a category deletes the row rather than changing the product. The link also records who filed the product there and when. Both sides hold the link in their productInCategorys list, so create and delete through the helpers on this class rather than adding to those lists directly, and changes are audited.
Group: Database Entities
Implements: Serializable, Auditable
Properties
| Property | Returns | Description |
|---|---|---|
| auditOrg | Organisation | The organisation which audit records for this link are filed against, which is the organisation owning the category. |
| category | Category | The category the product is filed in. Never null, and it is the category which carries the owning organisation. |
| createdBy | Profile | The profile which filed this product into the category. Can be null when the link was created by the system rather than by a person. |
| createdDate | Date | When the product was filed into the category. Stored as a date only, so the time of day is not kept. Never null. |
| id | long | Unique database identifier for this product to category link. |
| product | Product | The product filed in the category. Never null. |
Methods
getId() · setId(long id) · getCategory() · setCategory(Category category) · getProduct() · setProduct(Product product) · getCreatedBy() · setCreatedBy(Profile createdBy) · getCreatedDate() · setCreatedDate(Date createdDate) · getAuditOrg()
getId()
Returns: long
Unique database identifier for this product to category link.
setId(long id)
Returns: void
Sets the database identifier. The database assigns this when the link is first saved, so it is not normally set by hand.
| Parameter | Description |
|---|---|
id | the primary key to use |
getCategory()
Returns: Category
The category the product is filed in. Never null, and it is the category which carries the owning organisation.
setCategory(Category category)
Returns: void
Sets the category the product is filed in.
| Parameter | Description |
|---|---|
category | the category the product is in |
getProduct()
Returns: Product
The product filed in the category. Never null.
setProduct(Product product)
Returns: void
Sets the product filed in the category.
| Parameter | Description |
|---|---|
product | the product in the category |
getCreatedBy()
Returns: Profile
The profile which filed this product into the category. Can be null when the link was created by the system rather than by a person.
setCreatedBy(Profile createdBy)
Returns: void
Sets the profile recorded as having filed the product into the category.
| Parameter | Description |
|---|---|
createdBy | the profile which created the link |
getCreatedDate()
Returns: Date
When the product was filed into the category. Stored as a date only, so the time of day is not kept. Never null.
setCreatedDate(Date createdDate)
Returns: void
Sets the date the product was filed into the category.
| Parameter | Description |
|---|---|
createdDate | the date the link was created |
getAuditOrg()
Returns: Organisation
The organisation which audit records for this link are filed against, which is the organisation owning the category.