@Entity public class FeaturedProductImpl extends Object implements FeaturedProduct
| Modifier and Type | Field and Description |
|---|---|
protected Category |
category |
protected Long |
id
The id.
|
protected Product |
product |
protected String |
promotionMessage |
protected BigDecimal |
sequence |
| Constructor and Description |
|---|
FeaturedProductImpl() |
| Modifier and Type | Method and Description |
|---|---|
<G extends FeaturedProduct> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
Category |
getCategory() |
Long |
getId() |
Product |
getProduct() |
String |
getPromotionMessage() |
Product |
getRelatedProduct()
Pass through to getProduct() to meet the contract for promotable product.
|
BigDecimal |
getSequence() |
void |
setCategory(Category category) |
void |
setId(Long id) |
void |
setProduct(Product product) |
void |
setPromotionMessage(String promotionMessage) |
void |
setSequence(BigDecimal sequence) |
protected Long id
protected BigDecimal sequence
protected String promotionMessage
protected Category category
protected Product product
public Long getId()
getId in interface FeaturedProductpublic void setId(Long id)
setId in interface FeaturedProductpublic void setSequence(BigDecimal sequence)
setSequence in interface FeaturedProductpublic BigDecimal getSequence()
getSequence in interface FeaturedProductpublic String getPromotionMessage()
getPromotionMessage in interface FeaturedProductgetPromotionMessage in interface PromotableProductpublic void setPromotionMessage(String promotionMessage)
setPromotionMessage in interface FeaturedProductpublic Category getCategory()
getCategory in interface FeaturedProductpublic void setCategory(Category category)
setCategory in interface FeaturedProductpublic Product getProduct()
getProduct in interface FeaturedProductpublic void setProduct(Product product)
setProduct in interface FeaturedProductpublic Product getRelatedProduct()
FeaturedProductgetRelatedProduct in interface FeaturedProductgetRelatedProduct in interface PromotableProductpublic <G extends FeaturedProduct> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException
MultiTenantCloneable
public CreateResponse<MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException {
CreateResponse<MyClass> createResponse = super.createOrRetrieveCopyInstance(context);
if (createResponse.isAlreadyPopulated()) {
return createResponse;
}
MyClass myClone = createResponse.getClone();
//copy extended field values on myClone here
return createResponse;
}
Support should also be added for @Embeddable classes that contribute fields (collections or basic) to a cloneable entity:
public CreateResponse<G extends MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException {
CreateResponse createResponse = context.createOrRetrieveCopyInstance(this);
MyClass myClone = createResponse.getClone();
//copy extended field values on myClone here
return createResponse;
}
createOrRetrieveCopyInstance in interface MultiTenantCloneable<FeaturedProduct>context - a context object providing persistence and library functionality for copying entitiesCloneNotSupportedException - if there's a problem detected with the cloning configurationCopyright © 2015. All rights reserved.