@Entity public class CategoryAttributeImpl extends Object implements CategoryAttribute
| Modifier and Type | Field and Description |
|---|---|
protected Category |
category |
protected Long |
id |
protected String |
name |
protected Boolean |
searchable |
protected String |
value |
| Constructor and Description |
|---|
CategoryAttributeImpl() |
| Modifier and Type | Method and Description |
|---|---|
<G extends CategoryAttribute> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
boolean |
equals(Object obj) |
Category |
getCategory()
Gets the
Category. |
Long |
getId()
Gets the id.
|
String |
getName()
Gets the name.
|
Boolean |
getSearchable()
Whether or not this class contains searchable information
|
String |
getValue()
Gets the value.
|
int |
hashCode() |
void |
setCategory(Category category)
Sets the
Category. |
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 |
setValue(String value)
Sets the value.
|
String |
toString() |
protected Long id
protected String name
protected String value
protected Boolean searchable
protected Category category
public Long getId()
CategoryAttributegetId in interface CategoryAttributepublic void setId(Long id)
CategoryAttributesetId in interface CategoryAttributeid - the new idpublic String getValue()
CategoryAttributegetValue in interface ValueAssignable<String>getValue in interface CategoryAttributepublic void setValue(String value)
CategoryAttributesetValue in interface ValueAssignable<String>setValue in interface CategoryAttributevalue - the new 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()
CategoryAttributegetName in interface ValueAssignable<String>getName in interface CategoryAttributepublic void setName(String name)
CategoryAttributesetName in interface ValueAssignable<String>setName in interface CategoryAttributename - the new namepublic Category getCategory()
CategoryAttributeCategory.getCategory in interface CategoryAttributeCategorypublic void setCategory(Category category)
CategoryAttributeCategory.setCategory in interface CategoryAttributecategory - the new Categorypublic <G extends CategoryAttribute> 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<CategoryAttribute>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.