Class SearchFacetDaoImpl

java.lang.Object
org.broadleafcommerce.core.search.dao.SearchFacetDaoImpl
All Implemented Interfaces:
SearchFacetDao

@Repository("blSearchFacetDao") public class SearchFacetDaoImpl extends Object implements SearchFacetDao
  • Field Details

    • em

      protected jakarta.persistence.EntityManager em
    • entityConfiguration

      protected org.broadleafcommerce.common.persistence.EntityConfiguration entityConfiguration
  • Constructor Details

    • SearchFacetDaoImpl

      public SearchFacetDaoImpl()
  • Method Details

    • readAllSearchFacets

      public List<SearchFacet> readAllSearchFacets(FieldEntity entityType)
      Description copied from interface: SearchFacetDao
      Returns all SearchFacets that are tagged with showOnSearch for the given entity type
      Specified by:
      readAllSearchFacets in interface SearchFacetDao
      Returns:
      the facets to display on searches
    • readDistinctValuesForField

      public <T> List<T> readDistinctValuesForField(String fieldName, Class<T> fieldValueClass)
      Description copied from interface: SearchFacetDao
      Returns the distinct values for the given fieldName inside of the search clas sas a list of the specified type. For example, reading the distinct values for "manufacturer" in the ProductImpl class and specifying the value class as String would search the ProductImpl entity's distinct manufacturers and return a List of these values.
      Specified by:
      readDistinctValuesForField in interface SearchFacetDao
      Returns:
      the distinct values for the field
    • save

      public SearchFacet save(SearchFacet searchFacet)
      Description copied from interface: SearchFacetDao
      Persist to the data layer.
      Specified by:
      save in interface SearchFacetDao
      Parameters:
      searchFacet - the instance to persist
      Returns:
      the instance after it has been persisted
    • readSearchFacetForField

      public SearchFacet readSearchFacetForField(Field field)
      Description copied from interface: SearchFacetDao
      Returns a SearchFacet for the given field, if one exists
      Specified by:
      readSearchFacetForField in interface SearchFacetDao
      Parameters:
      field - the field to find a SearchFacet for
      Returns:
      the SearchFacet for the given field
    • readSearchFacetRangesForSearchFacet

      public List<SearchFacetRange> readSearchFacetRangesForSearchFacet(SearchFacet searchFacet)
      Description copied from interface: SearchFacetDao
      Returns a list of SearchFacetRanges for a given SearchFacet
      Specified by:
      readSearchFacetRangesForSearchFacet in interface SearchFacetDao
      Parameters:
      searchFacet - the SearchFacet to use
      Returns:
      the SearchFacetRanges for the given SearchFacet
    • isSearchFacetRangeArchivable

      protected boolean isSearchFacetRangeArchivable()