@Entity public class SkuAttributeImpl extends Object implements SkuAttribute
SkuAttribute.
A SKU Attribute is a designator on a SKU that differentiates it from other similar SKUs
(for example: Blue attribute for hat).
If you want to add fields specific to your implementation of BroadLeafCommerce you should extend
this class and add your fields. If you need to make significant changes to the SkuImpl then you
should implement your own version of Sku.
SkuAttribute}, {@link SkuImpl},
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected Long |
id
The id.
|
protected String |
name
The name.
|
protected Boolean |
searchable
The searchable.
|
protected Sku |
sku
The sku.
|
protected String |
value
The value.
|
| Constructor and Description |
|---|
SkuAttributeImpl() |
| Modifier and Type | Method and Description |
|---|---|
<G extends SkuAttribute> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
boolean |
equals(Object obj) |
Long |
getId()
Gets the id.
|
String |
getName()
Gets the name.
|
Boolean |
getSearchable()
Whether or not this class contains searchable information
|
Sku |
getSku()
Gets the sku.
|
String |
getValue()
The value
|
int |
hashCode() |
void |
setId(Long id)
Sets the id.
|
void |
setName(String name)
Sets the name.
|
void |
setSearchable(Boolean searchable)
Whether or not this class contains searchable information
|
void |
setSku(Sku sku)
Sets the sku.
|
void |
setValue(String value)
The value
|
String |
toString() |
protected Long id
protected String name
protected String value
protected Boolean searchable
protected Sku sku
public Long getId()
SkuAttributegetId in interface SkuAttributepublic void setId(Long id)
SkuAttributesetId in interface SkuAttributeid - 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()
SkuAttributegetName in interface ValueAssignable<String>getName in interface SkuAttributepublic void setName(String name)
SkuAttributesetName in interface ValueAssignable<String>setName in interface SkuAttributename - the new namepublic Sku getSku()
SkuAttributegetSku in interface SkuAttributepublic void setSku(Sku sku)
SkuAttributesetSku in interface SkuAttributesku - the new skupublic <G extends SkuAttribute> 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<SkuAttribute>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.