@Entity public class DataDrivenEnumerationValueImpl extends Object implements DataDrivenEnumerationValue
Modifier and Type | Field and Description |
---|---|
protected String |
display |
protected Boolean |
hidden |
protected Long |
id |
protected String |
key |
protected DataDrivenEnumeration |
type |
Constructor and Description |
---|
DataDrivenEnumerationValueImpl() |
Modifier and Type | Method and Description |
---|---|
<G extends DataDrivenEnumerationValue> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
String |
getDisplay() |
Boolean |
getHidden() |
Long |
getId() |
String |
getKey() |
DataDrivenEnumeration |
getType() |
void |
setDisplay(String display) |
void |
setHidden(Boolean hidden) |
void |
setId(Long id) |
void |
setKey(String key) |
void |
setType(DataDrivenEnumeration type) |
protected Long id
protected DataDrivenEnumeration type
protected String key
protected String display
protected Boolean hidden
public String getDisplay()
getDisplay
in interface DataDrivenEnumerationValue
public void setDisplay(String display)
setDisplay
in interface DataDrivenEnumerationValue
public Boolean getHidden()
getHidden
in interface DataDrivenEnumerationValue
public void setHidden(Boolean hidden)
setHidden
in interface DataDrivenEnumerationValue
public Long getId()
getId
in interface DataDrivenEnumerationValue
public void setId(Long id)
setId
in interface DataDrivenEnumerationValue
public String getKey()
getKey
in interface DataDrivenEnumerationValue
public void setKey(String key)
setKey
in interface DataDrivenEnumerationValue
public DataDrivenEnumeration getType()
getType
in interface DataDrivenEnumerationValue
public void setType(DataDrivenEnumeration type)
setType
in interface DataDrivenEnumerationValue
public <G extends DataDrivenEnumerationValue> 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<DataDrivenEnumerationValue>
context
- a context object providing persistence and library functionality for copying entitiesCloneNotSupportedException
- if there's a problem detected with the cloning configurationCopyright © 2022. All rights reserved.