@Entity public class StaticAssetDescriptionImpl extends Object implements StaticAssetDescription
Modifier and Type | Field and Description |
---|---|
protected AdminAuditable |
auditable |
protected String |
description |
protected Long |
id |
protected String |
longDescription |
Constructor and Description |
---|
StaticAssetDescriptionImpl() |
Modifier and Type | Method and Description |
---|---|
StaticAssetDescription |
cloneEntity() |
<G extends StaticAssetDescription> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
AdminAuditable |
getAuditable() |
String |
getDescription() |
Long |
getId() |
String |
getLongDescription() |
void |
setAuditable(AdminAuditable auditable) |
void |
setDescription(String description) |
void |
setId(Long id) |
void |
setLongDescription(String longDescription) |
protected Long id
protected AdminAuditable auditable
protected String description
protected String longDescription
public Long getId()
getId
in interface StaticAssetDescription
public void setId(Long id)
setId
in interface StaticAssetDescription
public String getDescription()
getDescription
in interface StaticAssetDescription
public void setDescription(String description)
setDescription
in interface StaticAssetDescription
public String getLongDescription()
getLongDescription
in interface StaticAssetDescription
public void setLongDescription(String longDescription)
setLongDescription
in interface StaticAssetDescription
public StaticAssetDescription cloneEntity()
cloneEntity
in interface StaticAssetDescription
public AdminAuditable getAuditable()
getAuditable
in interface StaticAssetDescription
public void setAuditable(AdminAuditable auditable)
setAuditable
in interface StaticAssetDescription
public <G extends StaticAssetDescription> 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<StaticAssetDescription>
context
- a context object providing persistence and library functionality for copying entitiesCloneNotSupportedException
- if there's a problem detected with the cloning configurationCopyright © 2017. All rights reserved.