@Entity public class UpSaleProductImpl extends Object implements RelatedProduct, MultiTenantCloneable<UpSaleProductImpl>
| Constructor and Description |
|---|
UpSaleProductImpl() |
| Modifier and Type | Method and Description |
|---|---|
<G extends UpSaleProductImpl> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
Category |
getCategory() |
Long |
getId() |
Product |
getProduct() |
String |
getPromotionMessage() |
Product |
getRelatedProduct() |
BigDecimal |
getSequence() |
void |
setCategory(Category category) |
void |
setId(Long id) |
void |
setProduct(Product product) |
void |
setPromotionMessage(String promotionMessage) |
void |
setRelatedProduct(Product relatedSaleProduct) |
void |
setSequence(BigDecimal sequence) |
protected Category category
public Long getId()
getId in interface RelatedProductpublic void setId(Long id)
setId in interface RelatedProductpublic String getPromotionMessage()
getPromotionMessage in interface PromotableProductgetPromotionMessage in interface RelatedProductpublic void setPromotionMessage(String promotionMessage)
setPromotionMessage in interface RelatedProductpublic BigDecimal getSequence()
getSequence in interface RelatedProductpublic void setSequence(BigDecimal sequence)
setSequence in interface RelatedProductpublic Product getProduct()
getProduct in interface RelatedProductpublic void setProduct(Product product)
setProduct in interface RelatedProductpublic Category getCategory()
getCategory in interface RelatedProductpublic void setCategory(Category category)
setCategory in interface RelatedProductpublic Product getRelatedProduct()
getRelatedProduct in interface PromotableProductgetRelatedProduct in interface RelatedProductpublic void setRelatedProduct(Product relatedSaleProduct)
setRelatedProduct in interface RelatedProductpublic <G extends UpSaleProductImpl> 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<UpSaleProductImpl>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.