Class CriteriaTransferObject
java.lang.Object
org.broadleafcommerce.openadmin.dto.CriteriaTransferObject
Generic persistent entity criteria transfer object.
Provides a storage mechanism for query related information regarding an entity.
- Author:
- Jeff Fischer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(FilterAndSortCriteria criteria) Add aFilterAndSortCriteriainstance.voidaddAll(Collection<FilterAndSortCriteria> criterias) Add allFilterAndSortCriteriainstances.voiddefaultSortDirectionForFieldIfUnset(String name, SortDirection defaultDirection) This list holds additional filter mappings that might have been constructed in a custom persistence handler.Retrieve the addedFilterAndSortCriteriainstances organized into a mapThe index of records in the database for which a fetch will start.Gets the folder ID to filter a fetch on so that only entities in a folder will be shown.The max number of records from the datastore to return.This list holds additional filter mappings that might have been constructed in a custom persistence handler.booleanTells if this is a foldered fetchvoidsetAdditionalFilterMappings(List<FilterMapping> additionalFilterMappings) voidsetCriteriaMap(Map<String, FilterAndSortCriteria> criteriaMap) voidsetFirstId(Long firstId) voidsetFirstResult(Integer firstResult) The index of records in the datastore for which a fetch will start.voidsetFolderId(Long folderId) voidsetFolderLookup(Boolean folderLookup) voidvoidsetLowerCount(Integer lowerCount) voidsetMaxResults(Integer maxResults) The max number of records from the datastore to return.voidsetNonCountAdditionalFilterMappings(List<FilterMapping> nonCountAdditionalFilterMappings) voidsetPresentationFetch(Boolean presentationFetch) voidsetUpperCount(Integer upperCount)
-
Constructor Details
-
CriteriaTransferObject
public CriteriaTransferObject()
-
-
Method Details
-
getFirstResult
The index of records in the database for which a fetch will start.- Returns:
- the index to start, or null
-
setFirstResult
The index of records in the datastore for which a fetch will start.- Parameters:
firstResult- the index to start, or null
-
getMaxResults
The max number of records from the datastore to return.- Returns:
- the max records, or null
-
setMaxResults
The max number of records from the datastore to return.- Parameters:
maxResults- the max records, or null
-
getLastId
-
setLastId
-
getFirstId
-
setFirstId
-
getUpperCount
-
setUpperCount
-
getLowerCount
-
setLowerCount
-
getPresentationFetch
-
setPresentationFetch
-
add
Add aFilterAndSortCriteriainstance. Contains information about which records are retrieved and in what direction they're sorted.- Parameters:
criteria-FilterAndSortCriteria
-
addAll
Add allFilterAndSortCriteriainstances. Contains information about which records are retrieved and in what direction they're sorted.- Parameters:
criterias- the list ofFilterAndSortCriteriainstances to add
-
getCriteriaMap
Retrieve the addedFilterAndSortCriteriainstances organized into a map- Returns:
- the
FilterAndSortCriteriainstances as a map
-
setCriteriaMap
-
get
-
defaultSortDirectionForFieldIfUnset
-
getAdditionalFilterMappings
This list holds additional filter mappings that might have been constructed in a custom persistence handler. This is only used when very custom filtering needs to occur. -
setAdditionalFilterMappings
-
getNonCountAdditionalFilterMappings
This list holds additional filter mappings that might have been constructed in a custom persistence handler. This is only used when very custom filtering needs to occur.These filter mappings will NOT be applied to the query that gathers the total number of results. This especially applies to queries that include join fetches where the total number of results should not include the join fetched items. An example of this is defaultSku and defaultCategory being join fetched when querying for a set of products. In this case, these filter mappings are applied to also return the defaultSku and defaultCategory of each product, but the total number of results should only include the number of products.
-
setNonCountAdditionalFilterMappings
public void setNonCountAdditionalFilterMappings(List<FilterMapping> nonCountAdditionalFilterMappings) -
isFolderLookup
public boolean isFolderLookup()Tells if this is a foldered fetch- Returns:
- true if this is a folder lookup, false otherwise
-
setFolderLookup
-
getFolderId
Gets the folder ID to filter a fetch on so that only entities in a folder will be shown. If this is null whilefolderLookupis true, this means find entities not assigned to a folder.- Returns:
- the folder ID
-
setFolderId
-