Class IndexFieldImpl

java.lang.Object
org.broadleafcommerce.core.search.domain.IndexFieldImpl
All Implemented Interfaces:
Serializable, AdminMainEntity, MultiTenantCloneable<IndexField>, IndexField, IndexFieldAdminPresentation

@Entity public class IndexFieldImpl extends Object implements IndexField, Serializable, IndexFieldAdminPresentation, AdminMainEntity
Author:
Chad Harchar (charchar)
See Also:
  • Field Details

  • Constructor Details

    • IndexFieldImpl

      public IndexFieldImpl()
  • Method Details

    • getId

      public Long getId()
      Description copied from interface: IndexField
      Gets the id for this search field
      Specified by:
      getId in interface IndexField
      Returns:
    • setId

      public void setId(Long id)
      Description copied from interface: IndexField
      Sets the id for this search field
      Specified by:
      setId in interface IndexField
    • getSearchable

      public Boolean getSearchable()
      Description copied from interface: IndexField
      Whether or not the user should see results for this field when typing in search terms in the omnibox, or if this is just a field stored in the index (like margin or sorts)
      Specified by:
      getSearchable in interface IndexField
    • setSearchable

      public void setSearchable(Boolean searchable)
      Specified by:
      setSearchable in interface IndexField
    • getField

      public Field getField()
      Description copied from interface: IndexField
      Gets the field for this search field
      Specified by:
      getField in interface IndexField
      Returns:
    • setField

      public void setField(Field field)
      Description copied from interface: IndexField
      Sets the field for this search field
      Specified by:
      setField in interface IndexField
    • getFieldTypes

      public List<IndexFieldType> getFieldTypes()
      Description copied from interface: IndexField
      Gets the searchable field types for this search field
      Specified by:
      getFieldTypes in interface IndexField
      Returns:
    • setFieldTypes

      public void setFieldTypes(List<IndexFieldType> fieldTypes)
      Description copied from interface: IndexField
      Sets the searchable field types for this search field
      Specified by:
      setFieldTypes in interface IndexField
    • createOrRetrieveCopyInstance

      public <G extends IndexField> 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<IndexField>
      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
    • getMainEntityName

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