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 Summary
FieldsModifier and TypeFieldDescriptionprotected jakarta.persistence.EntityManagerprotected org.broadleafcommerce.common.persistence.EntityConfiguration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanreadAllSearchFacets(FieldEntity entityType) Returns all SearchFacets that are tagged with showOnSearch for the given entity type<T> List<T>readDistinctValuesForField(String fieldName, Class<T> fieldValueClass) Returns the distinct values for the given fieldName inside of the search clas sas a list of the specified type.readSearchFacetForField(Field field) Returns a SearchFacet for the given field, if one existsreadSearchFacetRangesForSearchFacet(SearchFacet searchFacet) Returns a list of SearchFacetRanges for a given SearchFacetsave(SearchFacet searchFacet) Persist to the data layer.
-
Field Details
-
em
protected jakarta.persistence.EntityManager em -
entityConfiguration
protected org.broadleafcommerce.common.persistence.EntityConfiguration entityConfiguration
-
-
Constructor Details
-
SearchFacetDaoImpl
public SearchFacetDaoImpl()
-
-
Method Details
-
readAllSearchFacets
Description copied from interface:SearchFacetDaoReturns all SearchFacets that are tagged with showOnSearch for the given entity type- Specified by:
readAllSearchFacetsin interfaceSearchFacetDao- Returns:
- the facets to display on searches
-
readDistinctValuesForField
Description copied from interface:SearchFacetDaoReturns 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 Listof these values. - Specified by:
readDistinctValuesForFieldin interfaceSearchFacetDao- Returns:
- the distinct values for the field
-
save
Description copied from interface:SearchFacetDaoPersist to the data layer.- Specified by:
savein interfaceSearchFacetDao- Parameters:
searchFacet- the instance to persist- Returns:
- the instance after it has been persisted
-
readSearchFacetForField
Description copied from interface:SearchFacetDaoReturns a SearchFacet for the given field, if one exists- Specified by:
readSearchFacetForFieldin interfaceSearchFacetDao- Parameters:
field- the field to find a SearchFacet for- Returns:
- the SearchFacet for the given field
-
readSearchFacetRangesForSearchFacet
Description copied from interface:SearchFacetDaoReturns a list of SearchFacetRanges for a given SearchFacet- Specified by:
readSearchFacetRangesForSearchFacetin interfaceSearchFacetDao- Parameters:
searchFacet- the SearchFacet to use- Returns:
- the SearchFacetRanges for the given SearchFacet
-
isSearchFacetRangeArchivable
protected boolean isSearchFacetRangeArchivable()
-