Class StructuredContentFieldImpl
java.lang.Object
org.broadleafcommerce.cms.structure.domain.StructuredContentFieldImpl
- All Implemented Interfaces:
Serializable
,Cloneable
,StructuredContentField
,MultiTenantCloneable<StructuredContentField>
,ProfileEntity
@Entity
public class StructuredContentFieldImpl
extends Object
implements StructuredContentField, ProfileEntity
Created by bpolster.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
<G extends StructuredContentField>
CreateResponse<G>Clone this entity for the purpose of multiple tenancy.Returns the fieldKey associated with this field.getId()
Gets the primary key.getValue()
Sets the value of this custom field.void
setFieldKey
(String fieldKey) Sets the fieldKey.void
Sets the primary key.void
Returns the value for this custom field.
-
Field Details
-
id
-
fieldKey
-
stringValue
-
lobValue
-
-
Constructor Details
-
StructuredContentFieldImpl
public StructuredContentFieldImpl()
-
-
Method Details
-
getId
Description copied from interface:StructuredContentField
Gets the primary key.- Specified by:
getId
in interfaceStructuredContentField
- Returns:
- the primary key
-
setId
Description copied from interface:StructuredContentField
Sets the primary key.- Specified by:
setId
in interfaceStructuredContentField
- Parameters:
id
- the new primary key
-
getFieldKey
Description copied from interface:StructuredContentField
Returns the fieldKey associated with this field. The key used for aStructuredContentField
is determined by the associatedFieldDefinition
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".- Specified by:
getFieldKey
in interfaceStructuredContentField
- Returns:
- the key associated with this item
- See Also:
-
setFieldKey
Description copied from interface:StructuredContentField
Sets the fieldKey.- Specified by:
setFieldKey
in interfaceStructuredContentField
- See Also:
-
getValue
Description copied from interface:StructuredContentField
Sets the value of this custom field.- Specified by:
getValue
in interfaceStructuredContentField
- Returns:
-
setValue
Description copied from interface:StructuredContentField
Returns the value for this custom field.- Specified by:
setValue
in interfaceStructuredContentField
-
clone
- Specified by:
clone
in interfaceStructuredContentField
- Overrides:
clone
in classObject
- Returns:
- a deep copy of this object. By default, clones the fieldKey and value fields and ignores the auditable and id fields.
-
createOrRetrieveCopyInstance
public <G extends StructuredContentField> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException Description copied from interface:MultiTenantCloneable
Clone this entity for the purpose of multiple tenancy. Note, extending classes should follow this pattern:public CreateResponse<MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException { CreateResponse<MyClass> createResponse = super.createOrRetrieveCopyInstance(context); if (createResponse.isAlreadyPopulated()) { return createResponse; } MyClass myClone = createResponse.getClone();
Support should also be added for @Embeddable classes that contribute fields (collections or basic) to a cloneable entity://copy extended field values on myClone here
return createResponse; }
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; }
- Specified by:
createOrRetrieveCopyInstance
in interfaceMultiTenantCloneable<StructuredContentField>
- Parameters:
context
- a context object providing persistence and library functionality for copying entities- Returns:
- the resulting copy container, possibly already persisted
- Throws:
CloneNotSupportedException
- if there's a problem detected with the cloning configuration
-