@Entity public class FieldImpl extends Object implements Field, FieldAdminPresentation, AdminMainEntity
FieldAdminPresentation.FieldOrder, FieldAdminPresentation.GroupName, FieldAdminPresentation.GroupOrder, FieldAdminPresentation.TabName, FieldAdminPresentation.TabOrder
Modifier and Type | Field and Description |
---|---|
protected String |
abbreviation |
protected String |
entityType |
protected String |
friendlyName |
protected Long |
id |
protected Boolean |
overrideGeneratedPropertyName |
protected String |
propertyName |
protected Boolean |
translatable |
MAIN_ENTITY_NAME_PROPERTY
Constructor and Description |
---|
FieldImpl() |
Modifier and Type | Method and Description |
---|---|
<G extends Field> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
boolean |
equals(Object obj) |
String |
getAbbreviation()
Gets the abbreviation of this Field.
|
FieldEntity |
getEntityType()
Gets the entityType of this Field
|
String |
getFriendlyName()
Returns the friendly name of the field, for use by admin or other UI.
|
Long |
getId()
Gets the id
|
String |
getMainEntityName() |
Boolean |
getOverrideGeneratedPropertyName() |
String |
getPropertyName()
Gets the propertyName of this Field.
|
String |
getQualifiedFieldName()
Returns the qualified name of this Field.
|
List<SearchConfig> |
getSearchConfigs()
Deprecated.
|
Boolean |
getTranslatable()
Returns whether or not this field should be considered translatable
|
void |
setAbbreviation(String abbreviation)
Sets the abbreviation
|
void |
setEntityType(FieldEntity entityType)
Sets the entityType
|
void |
setFriendlyName(String friendlyName)
The friendly name of the field, for use by admin or other UI.
|
void |
setId(Long id)
Sets the id
|
void |
setOverrideGeneratedPropertyName(Boolean overrideGeneratedPropertyName) |
void |
setPropertyName(String propertyName)
Sets the propertyName
|
void |
setSearchConfigs(List<SearchConfig> searchConfigs)
Deprecated.
|
void |
setTranslatable(Boolean translatable)
Sets whether or not this field should be considered translatable
|
protected Long id
protected String entityType
protected String friendlyName
protected String propertyName
protected Boolean overrideGeneratedPropertyName
protected String abbreviation
protected Boolean translatable
public String getQualifiedFieldName()
Field
getQualifiedFieldName
in interface Field
public FieldEntity getEntityType()
Field
getEntityType
in interface Field
public void setEntityType(FieldEntity entityType)
Field
setEntityType
in interface Field
public String getPropertyName()
Field
getPropertyName
in interface Field
public void setPropertyName(String propertyName)
Field
setPropertyName
in interface Field
public Boolean getOverrideGeneratedPropertyName()
getOverrideGeneratedPropertyName
in interface Field
public void setOverrideGeneratedPropertyName(Boolean overrideGeneratedPropertyName)
setOverrideGeneratedPropertyName
in interface Field
public String getAbbreviation()
Field
getAbbreviation
in interface Field
public void setAbbreviation(String abbreviation)
Field
setAbbreviation
in interface Field
public String getFriendlyName()
Field
getFriendlyName
in interface Field
public void setFriendlyName(String friendlyName)
Field
setFriendlyName
in interface Field
public Boolean getTranslatable()
Field
getTranslatable
in interface Field
public void setTranslatable(Boolean translatable)
Field
setTranslatable
in interface Field
@Deprecated public List<SearchConfig> getSearchConfigs()
Field
getSearchConfigs
in interface Field
@Deprecated public void setSearchConfigs(List<SearchConfig> searchConfigs)
Field
setSearchConfigs
in interface Field
public String getMainEntityName()
getMainEntityName
in interface AdminMainEntity
public <G extends Field> 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<Field>
context
- a context object providing persistence and library functionality for copying entitiesCloneNotSupportedException
- if there's a problem detected with the cloning configurationCopyright © 2020. All rights reserved.