@Entity public class ProductAttributeImpl extends Object implements ProductAttribute
| Modifier and Type | Field and Description |
|---|---|
protected Long |
id
The id.
|
protected String |
name
The name.
|
protected Product |
product
The product.
|
protected Boolean |
searchable
The searchable.
|
protected String |
value
The value.
|
| Constructor and Description |
|---|
ProductAttributeImpl() |
| Modifier and Type | Method and Description |
|---|---|
<G extends ProductAttribute> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
boolean |
equals(Object obj) |
Long |
getId()
Gets the id.
|
String |
getName()
The name
|
Product |
getProduct()
Gets the product.
|
Boolean |
getSearchable()
Whether or not this class contains searchable information
|
String |
getValue()
The value
|
int |
hashCode() |
void |
setId(Long id)
Sets the id.
|
void |
setName(String name)
The name
|
void |
setProduct(Product product)
Sets the product.
|
void |
setSearchable(Boolean searchable)
Whether or not this class contains searchable information
|
void |
setValue(String value)
The value
|
String |
toString() |
protected Long id
protected String name
protected String value
protected Boolean searchable
protected Product product
public Long getId()
ProductAttributegetId in interface ProductAttributepublic void setId(Long id)
ProductAttributesetId in interface ProductAttributeid - the new idpublic String getValue()
ValueAssignablegetValue in interface ValueAssignable<String>public void setValue(String value)
ValueAssignablesetValue in interface ValueAssignable<String>value - The valuepublic Boolean getSearchable()
SearchablegetSearchable in interface Searchable<String>public void setSearchable(Boolean searchable)
SearchablesetSearchable in interface Searchable<String>searchable - Whether or not this class contains searchable informationpublic String getName()
ValueAssignablegetName in interface ValueAssignable<String>public void setName(String name)
ValueAssignablesetName in interface ValueAssignable<String>name - The namepublic Product getProduct()
ProductAttributegetProduct in interface ProductAttributepublic void setProduct(Product product)
ProductAttributesetProduct in interface ProductAttributeproduct - the new productpublic <G extends ProductAttribute> 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<ProductAttribute>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.