@Entity public class StructuredContentFieldTemplateImpl extends Object implements StructuredContentFieldTemplate
Modifier and Type | Field and Description |
---|---|
protected List<FieldGroup> |
fieldGroups |
protected Long |
id |
protected String |
name |
Constructor and Description |
---|
StructuredContentFieldTemplateImpl() |
Modifier and Type | Method and Description |
---|---|
<G extends StructuredContentFieldTemplate> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
List<FieldGroup> |
getFieldGroups()
Returns the list of the field groups for this template.
|
Long |
getId()
Gets the primary key.
|
String |
getName()
Gets the name.
|
void |
setFieldGroups(List<FieldGroup> fieldGroups)
Sets the list of field groups for this template.
|
void |
setId(Long id)
Sets the primary key.
|
void |
setName(String name)
Sets the name.
|
protected Long id
protected String name
protected List<FieldGroup> fieldGroups
public Long getId()
StructuredContentFieldTemplate
getId
in interface StructuredContentFieldTemplate
public void setId(Long id)
StructuredContentFieldTemplate
setId
in interface StructuredContentFieldTemplate
id
- the new primary keypublic String getName()
StructuredContentFieldTemplate
getName
in interface StructuredContentFieldTemplate
public void setName(String name)
StructuredContentFieldTemplate
setName
in interface StructuredContentFieldTemplate
public List<FieldGroup> getFieldGroups()
StructuredContentFieldTemplate
getFieldGroups
in interface StructuredContentFieldTemplate
public void setFieldGroups(List<FieldGroup> fieldGroups)
StructuredContentFieldTemplate
setFieldGroups
in interface StructuredContentFieldTemplate
public <G extends StructuredContentFieldTemplate> 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<StructuredContentFieldTemplate>
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.