@Entity public class FieldGroupImpl extends Object implements FieldGroup, ProfileEntity
Modifier and Type | Field and Description |
---|---|
protected List<FieldDefinition> |
fieldDefinitions |
protected Long |
id |
protected Boolean |
initCollapsedFlag |
protected Boolean |
isMasterFieldGroup |
protected String |
name |
Constructor and Description |
---|
FieldGroupImpl() |
Modifier and Type | Method and Description |
---|---|
<G extends FieldGroup> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
List<FieldDefinition> |
getFieldDefinitions() |
Long |
getId() |
Boolean |
getInitCollapsedFlag() |
String |
getName() |
Boolean |
isMasterFieldGroup() |
void |
setFieldDefinitions(List<FieldDefinition> fieldDefinitions) |
void |
setId(Long id) |
void |
setInitCollapsedFlag(Boolean initCollapsedFlag) |
void |
setIsMasterFieldGroup(Boolean isMasterFieldGroup) |
void |
setName(String name) |
protected Long id
protected String name
protected Boolean initCollapsedFlag
protected List<FieldDefinition> fieldDefinitions
protected Boolean isMasterFieldGroup
public Long getId()
getId
in interface FieldGroup
public void setId(Long id)
setId
in interface FieldGroup
public String getName()
getName
in interface FieldGroup
public void setName(String name)
setName
in interface FieldGroup
public Boolean getInitCollapsedFlag()
getInitCollapsedFlag
in interface FieldGroup
public void setInitCollapsedFlag(Boolean initCollapsedFlag)
setInitCollapsedFlag
in interface FieldGroup
public List<FieldDefinition> getFieldDefinitions()
getFieldDefinitions
in interface FieldGroup
public void setFieldDefinitions(List<FieldDefinition> fieldDefinitions)
setFieldDefinitions
in interface FieldGroup
public <G extends FieldGroup> 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<FieldGroup>
context
- a context object providing persistence and library functionality for copying entitiesCloneNotSupportedException
- if there's a problem detected with the cloning configurationpublic Boolean isMasterFieldGroup()
isMasterFieldGroup
in interface FieldGroup
public void setIsMasterFieldGroup(Boolean isMasterFieldGroup)
setIsMasterFieldGroup
in interface FieldGroup
Copyright © 2019. All rights reserved.