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 Details

    • id

      protected Long id
    • fieldKey

      protected String fieldKey
    • stringValue

      protected String stringValue
    • lobValue

      protected String lobValue
  • Constructor Details

    • StructuredContentFieldImpl

      public StructuredContentFieldImpl()
  • Method Details

    • getId

      public Long getId()
      Description copied from interface: StructuredContentField
      Gets the primary key.
      Specified by:
      getId in interface StructuredContentField
      Returns:
      the primary key
    • setId

      public void setId(Long id)
      Description copied from interface: StructuredContentField
      Sets the primary key.
      Specified by:
      setId in interface StructuredContentField
      Parameters:
      id - the new primary key
    • getFieldKey

      public String getFieldKey()
      Description copied from interface: StructuredContentField
      Returns the fieldKey associated with this field. The key used for a 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".

      Specified by:
      getFieldKey in interface StructuredContentField
      Returns:
      the key associated with this item
      See Also:
    • setFieldKey

      public void setFieldKey(String fieldKey)
      Description copied from interface: StructuredContentField
      Sets the fieldKey.
      Specified by:
      setFieldKey in interface StructuredContentField
      See Also:
    • getValue

      public String getValue()
      Description copied from interface: StructuredContentField
      Sets the value of this custom field.
      Specified by:
      getValue in interface StructuredContentField
      Returns:
    • setValue

      public void setValue(String value)
      Description copied from interface: StructuredContentField
      Returns the value for this custom field.
      Specified by:
      setValue in interface StructuredContentField
    • clone

      public StructuredContentField clone()
      Specified by:
      clone in interface StructuredContentField
      Overrides:
      clone in class Object
      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();

      //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; }

      Specified by:
      createOrRetrieveCopyInstance in interface MultiTenantCloneable<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