Class FieldImpl

java.lang.Object
org.broadleafcommerce.core.search.domain.FieldImpl
All Implemented Interfaces:
Serializable, AdminMainEntity, MultiTenantCloneable<Field>, Field, FieldAdminPresentation

@Entity public class FieldImpl extends Object implements Field, FieldAdminPresentation, AdminMainEntity
See Also:
  • Field Details

    • id

      protected Long id
    • entityType

      protected String entityType
    • friendlyName

      protected String friendlyName
    • propertyName

      protected String propertyName
    • overrideGeneratedPropertyName

      protected Boolean overrideGeneratedPropertyName
    • abbreviation

      protected String abbreviation
    • translatable

      protected Boolean translatable
  • Constructor Details

    • FieldImpl

      public FieldImpl()
  • Method Details

    • getQualifiedFieldName

      public String getQualifiedFieldName()
      Description copied from interface: Field
      Returns the qualified name of this Field. The default implementation returns the entityType joined with the properName by a "."
      Specified by:
      getQualifiedFieldName in interface Field
      Returns:
      the qualifiedFieldName
    • getId

      public Long getId()
      Description copied from interface: Field
      Gets the id
      Specified by:
      getId in interface Field
      Returns:
      the id
    • setId

      public void setId(Long id)
      Description copied from interface: Field
      Sets the id
      Specified by:
      setId in interface Field
    • getEntityType

      public FieldEntity getEntityType()
      Description copied from interface: Field
      Gets the entityType of this Field
      Specified by:
      getEntityType in interface Field
      Returns:
      the entityType
    • setEntityType

      public void setEntityType(FieldEntity entityType)
      Description copied from interface: Field
      Sets the entityType
      Specified by:
      setEntityType in interface Field
    • getPropertyName

      public String getPropertyName()
      Description copied from interface: Field
      Gets the propertyName of this Field. This would be something like "manufacturer" or "defaultSku.price" if the EntityType was "product"
      Specified by:
      getPropertyName in interface Field
      Returns:
      the propertyName
    • setPropertyName

      public void setPropertyName(String propertyName)
      Description copied from interface: Field
      Sets the propertyName
      Specified by:
      setPropertyName in interface Field
    • getOverrideGeneratedPropertyName

      public Boolean getOverrideGeneratedPropertyName()
      Specified by:
      getOverrideGeneratedPropertyName in interface Field
    • setOverrideGeneratedPropertyName

      public void setOverrideGeneratedPropertyName(Boolean overrideGeneratedPropertyName)
      Specified by:
      setOverrideGeneratedPropertyName in interface Field
    • getAbbreviation

      public String getAbbreviation()
      Description copied from interface: Field
      Gets the abbreviation of this Field. This will be used in URL query string parameters for sorting and filtering
      Specified by:
      getAbbreviation in interface Field
      Returns:
      the abbreviation
    • setAbbreviation

      public void setAbbreviation(String abbreviation)
      Description copied from interface: Field
      Sets the abbreviation
      Specified by:
      setAbbreviation in interface Field
    • getFriendlyName

      public String getFriendlyName()
      Description copied from interface: Field
      Returns the friendly name of the field, for use by admin or other UI.
      Specified by:
      getFriendlyName in interface Field
      Returns:
    • setFriendlyName

      public void setFriendlyName(String friendlyName)
      Description copied from interface: Field
      The friendly name of the field, for use by admin or other UI.
      Specified by:
      setFriendlyName in interface Field
    • getTranslatable

      public Boolean getTranslatable()
      Description copied from interface: Field
      Returns whether or not this field should be considered translatable
      Specified by:
      getTranslatable in interface Field
      Returns:
      translatable
    • setTranslatable

      public void setTranslatable(Boolean translatable)
      Description copied from interface: Field
      Sets whether or not this field should be considered translatable
      Specified by:
      setTranslatable in interface Field
    • getSearchConfigs

      @Deprecated public List<SearchConfig> getSearchConfigs()
      Deprecated.
      Description copied from interface: Field
      Gets the searchConfigs. Note that a concrete implementation or usage of this class is not available in the community version of Broadleaf Commerce.
      Specified by:
      getSearchConfigs in interface Field
      Returns:
      the searchConfigs
    • setSearchConfigs

      @Deprecated public void setSearchConfigs(List<SearchConfig> searchConfigs)
      Deprecated.
      Description copied from interface: Field
      Sets the searchConfigs.
      Specified by:
      setSearchConfigs in interface Field
    • getMainEntityName

      public String getMainEntityName()
      Specified by:
      getMainEntityName in interface AdminMainEntity
      Returns:
      the display name of this entity for the admin screen
    • createOrRetrieveCopyInstance

      public <G extends Field> 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<Field>
      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
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object