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.voidsetFieldKey(String fieldKey) Sets the fieldKey.voidSets the primary key.voidReturns the value for this custom field.
-
Field Details
-
id
-
fieldKey
-
stringValue
-
lobValue
-
-
Constructor Details
-
StructuredContentFieldImpl
public StructuredContentFieldImpl()
-
-
Method Details
-
getId
Description copied from interface:StructuredContentFieldGets the primary key.- Specified by:
getIdin interfaceStructuredContentField- Returns:
- the primary key
-
setId
Description copied from interface:StructuredContentFieldSets the primary key.- Specified by:
setIdin interfaceStructuredContentField- Parameters:
id- the new primary key
-
getFieldKey
Description copied from interface:StructuredContentFieldReturns the fieldKey associated with this field. The key used for aStructuredContentFieldis determined by the associatedFieldDefinitionthat was used by the Content Management System to create this instance.As an example, a
StructuredContentTypemight be configured to contain a field definition with a key of "targetUrl".- Specified by:
getFieldKeyin interfaceStructuredContentField- Returns:
- the key associated with this item
- See Also:
-
setFieldKey
Description copied from interface:StructuredContentFieldSets the fieldKey.- Specified by:
setFieldKeyin interfaceStructuredContentField- See Also:
-
getValue
Description copied from interface:StructuredContentFieldSets the value of this custom field.- Specified by:
getValuein interfaceStructuredContentField- Returns:
-
setValue
Description copied from interface:StructuredContentFieldReturns the value for this custom field.- Specified by:
setValuein interfaceStructuredContentField
-
clone
- Specified by:
clonein interfaceStructuredContentField- Overrides:
clonein 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:MultiTenantCloneableClone 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 { CreateResponsecreateResponse = context.createOrRetrieveCopyInstance(this); MyClass myClone = createResponse.getClone(); //copy extended field values on myClone here
return createResponse; }
- Specified by:
createOrRetrieveCopyInstancein 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
-