@Entity public class StructuredContentTypeImpl extends Object implements StructuredContentType, AdminMainEntity, ProfileEntity
| Modifier and Type | Field and Description |
|---|---|
protected String |
description |
protected Long |
id |
protected String |
name |
protected StructuredContentFieldTemplate |
structuredContentFieldTemplate |
MAIN_ENTITY_NAME_PROPERTY| Constructor and Description |
|---|
StructuredContentTypeImpl() |
| Modifier and Type | Method and Description |
|---|---|
<G extends StructuredContentType> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
String |
getDescription()
Gets the description.
|
Long |
getId()
Gets the primary key.
|
String |
getMainEntityName() |
String |
getName()
Gets the name.
|
StructuredContentFieldTemplate |
getStructuredContentFieldTemplate()
Returns the template associated with this content type.
|
void |
setDescription(String description)
Sets the description.
|
void |
setId(Long id)
Sets the primary key.
|
void |
setName(String name)
Sets the name.
|
void |
setStructuredContentFieldTemplate(StructuredContentFieldTemplate scft)
Sets the template associated with this content type.
|
protected Long id
protected String name
protected String description
protected StructuredContentFieldTemplate structuredContentFieldTemplate
public Long getId()
StructuredContentTypegetId in interface StructuredContentTypepublic void setId(Long id)
StructuredContentTypesetId in interface StructuredContentTypeid - the new primary keypublic String getName()
StructuredContentTypegetName in interface StructuredContentTypepublic void setName(String name)
StructuredContentTypesetName in interface StructuredContentTypepublic String getDescription()
StructuredContentTypegetDescription in interface StructuredContentTypepublic void setDescription(String description)
StructuredContentTypesetDescription in interface StructuredContentTypepublic StructuredContentFieldTemplate getStructuredContentFieldTemplate()
StructuredContentTypegetStructuredContentFieldTemplate in interface StructuredContentTypepublic void setStructuredContentFieldTemplate(StructuredContentFieldTemplate scft)
StructuredContentTypesetStructuredContentFieldTemplate in interface StructuredContentTypepublic String getMainEntityName()
getMainEntityName in interface AdminMainEntitypublic <G extends StructuredContentType> 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<StructuredContentType>context - a context object providing persistence and library functionality for copying entitiesCloneNotSupportedException - if there's a problem detected with the cloning configurationCopyright © 2015. All rights reserved.