@Entity public class ProductOptionValueImpl extends Object implements ProductOptionValue
| Modifier and Type | Class and Description |
|---|---|
static class |
ProductOptionValueImpl.Presentation |
| Modifier and Type | Field and Description |
|---|---|
protected String |
attributeValue |
protected Long |
displayOrder |
protected Long |
id |
protected BigDecimal |
priceAdjustment |
protected ProductOption |
productOption |
| Constructor and Description |
|---|
ProductOptionValueImpl() |
| Modifier and Type | Method and Description |
|---|---|
<G extends ProductOptionValue> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
boolean |
equals(Object obj) |
String |
getAttributeValue()
Gets the option value.
|
Long |
getDisplayOrder()
Returns the order that the option value should be displayed in.
|
Long |
getId()
Returns unique identifier of the product option value.
|
Money |
getPriceAdjustment()
Gets the price adjustment associated with this value.
|
ProductOption |
getProductOption()
Returns the associated ProductOption
|
void |
setAttributeValue(String attributeValue)
Sets the option value.
|
void |
setDisplayOrder(Long displayOrder)
Sets the display order.
|
void |
setId(Long id)
Sets the unique identifier of the product option value.
|
void |
setPriceAdjustment(Money priceAdjustment)
Gets the price adjustment associated with this value.
|
void |
setProductOption(ProductOption productOption)
Sets the associated product option.
|
protected Long id
protected String attributeValue
protected Long displayOrder
protected BigDecimal priceAdjustment
protected ProductOption productOption
public Long getId()
ProductOptionValuegetId in interface ProductOptionValuepublic void setId(Long id)
ProductOptionValuesetId in interface ProductOptionValuepublic String getAttributeValue()
ProductOptionValuegetAttributeValue in interface ProductOptionValuepublic void setAttributeValue(String attributeValue)
ProductOptionValuesetAttributeValue in interface ProductOptionValuepublic Long getDisplayOrder()
ProductOptionValuegetDisplayOrder in interface ProductOptionValuepublic void setDisplayOrder(Long displayOrder)
ProductOptionValuesetDisplayOrder in interface ProductOptionValuepublic Money getPriceAdjustment()
ProductOptionValuegetPriceAdjustment in interface ProductOptionValuepublic void setPriceAdjustment(Money priceAdjustment)
ProductOptionValuesetPriceAdjustment in interface ProductOptionValuepublic ProductOption getProductOption()
ProductOptionValuegetProductOption in interface ProductOptionValuepublic void setProductOption(ProductOption productOption)
ProductOptionValuesetProductOption in interface ProductOptionValuepublic <G extends ProductOptionValue> 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<ProductOptionValue>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.