@Entity public class StructuredContentFieldImpl extends Object implements StructuredContentField, ProfileEntity
Modifier and Type | Field and Description |
---|---|
protected String |
fieldKey |
protected Long |
id |
protected String |
lobValue |
protected String |
stringValue |
Constructor and Description |
---|
StructuredContentFieldImpl() |
Modifier and Type | Method and Description |
---|---|
StructuredContentField |
clone() |
<G extends StructuredContentField> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
String |
getFieldKey()
Returns the fieldKey associated with this field.
|
Long |
getId()
Gets the primary key.
|
String |
getValue()
Sets the value of this custom field.
|
void |
setFieldKey(String fieldKey)
Sets the fieldKey.
|
void |
setId(Long id)
Sets the primary key.
|
void |
setValue(String value)
Returns the value for this custom field.
|
protected Long id
protected String fieldKey
protected String stringValue
protected String lobValue
public Long getId()
StructuredContentField
getId
in interface StructuredContentField
public void setId(Long id)
StructuredContentField
setId
in interface StructuredContentField
id
- the new primary keypublic String getFieldKey()
StructuredContentField
StructuredContentField
is determined by the associated
FieldDefinition
that was used by the
Content Management System to create this instance.
As an example, a StructuredContentType
might be configured to contain a
field definition with a key of "targetUrl".getFieldKey
in interface StructuredContentField
FieldDefinition
public void setFieldKey(String fieldKey)
StructuredContentField
setFieldKey
in interface StructuredContentField
FieldDefinition
public String getValue()
StructuredContentField
getValue
in interface StructuredContentField
public void setValue(String value)
StructuredContentField
setValue
in interface StructuredContentField
public StructuredContentField clone()
clone
in interface StructuredContentField
clone
in class Object
public <G extends StructuredContentField> 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<StructuredContentField>
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.