@Entity public class StructuredContentFieldTemplateImpl extends Object implements StructuredContentFieldTemplate
Modifier and Type | Field and Description |
---|---|
protected List<StructuredContentFieldGroupXref> |
fieldGroupXrefs |
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.
|
List<StructuredContentFieldGroupXref> |
getFieldGroupXrefs() |
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 |
setFieldGroupXrefs(List<StructuredContentFieldGroupXref> fieldGroupXrefs) |
void |
setId(Long id)
Sets the primary key.
|
void |
setName(String name)
Sets the name.
|
protected Long id
protected String name
protected List<StructuredContentFieldGroupXref> fieldGroupXrefs
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 List<StructuredContentFieldGroupXref> getFieldGroupXrefs()
getFieldGroupXrefs
in interface StructuredContentFieldTemplate
public void setFieldGroupXrefs(List<StructuredContentFieldGroupXref> fieldGroupXrefs)
setFieldGroupXrefs
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 © 2022. All rights reserved.