@Entity public class TranslationImpl extends Object implements Serializable, Translation
Modifier and Type | Field and Description |
---|---|
protected String |
entityId |
protected String |
entityType |
protected String |
fieldName |
protected Long |
id |
protected String |
localeCode |
protected String |
translatedValue |
Constructor and Description |
---|
TranslationImpl() |
Modifier and Type | Method and Description |
---|---|
<G extends Translation> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
String |
getEntityId() |
TranslatedEntity |
getEntityType() |
String |
getFieldName() |
Long |
getId() |
String |
getLocaleCode() |
String |
getTranslatedValue() |
void |
setEntityId(String entityId) |
void |
setEntityType(TranslatedEntity entityType) |
void |
setFieldName(String fieldName) |
void |
setId(Long id) |
void |
setLocaleCode(String localeCode) |
void |
setTranslatedValue(String translatedValue) |
protected Long id
protected String entityType
protected String entityId
protected String fieldName
protected String localeCode
protected String translatedValue
public TranslatedEntity getEntityType()
getEntityType
in interface Translation
public void setEntityType(TranslatedEntity entityType)
setEntityType
in interface Translation
public Long getId()
getId
in interface Translation
public void setId(Long id)
setId
in interface Translation
public String getEntityId()
getEntityId
in interface Translation
public void setEntityId(String entityId)
setEntityId
in interface Translation
public String getFieldName()
getFieldName
in interface Translation
public void setFieldName(String fieldName)
setFieldName
in interface Translation
public String getLocaleCode()
getLocaleCode
in interface Translation
public void setLocaleCode(String localeCode)
setLocaleCode
in interface Translation
public String getTranslatedValue()
getTranslatedValue
in interface Translation
public void setTranslatedValue(String translatedValue)
setTranslatedValue
in interface Translation
public <G extends Translation> 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<Translation>
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.