@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 Translationpublic void setEntityType(TranslatedEntity entityType)
setEntityType in interface Translationpublic Long getId()
getId in interface Translationpublic void setId(Long id)
setId in interface Translationpublic String getEntityId()
getEntityId in interface Translationpublic void setEntityId(String entityId)
setEntityId in interface Translationpublic String getFieldName()
getFieldName in interface Translationpublic void setFieldName(String fieldName)
setFieldName in interface Translationpublic String getLocaleCode()
getLocaleCode in interface Translationpublic void setLocaleCode(String localeCode)
setLocaleCode in interface Translationpublic String getTranslatedValue()
getTranslatedValue in interface Translationpublic void setTranslatedValue(String translatedValue)
setTranslatedValue in interface Translationpublic <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.