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 TypeMethodDescriptionvoid
add
(FilterAndSortCriteria criteria) Add aFilterAndSortCriteria
instance.void
addAll
(Collection<FilterAndSortCriteria> criterias) Add allFilterAndSortCriteria
instances.void
defaultSortDirectionForFieldIfUnset
(String name, SortDirection defaultDirection) This list holds additional filter mappings that might have been constructed in a custom persistence handler.Retrieve the addedFilterAndSortCriteria
instances 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.boolean
Tells if this is a foldered fetchvoid
setAdditionalFilterMappings
(List<FilterMapping> additionalFilterMappings) void
setCriteriaMap
(Map<String, FilterAndSortCriteria> criteriaMap) void
setFirstId
(Long firstId) void
setFirstResult
(Integer firstResult) The index of records in the datastore for which a fetch will start.void
setFolderId
(Long folderId) void
setFolderLookup
(Boolean folderLookup) void
void
setLowerCount
(Integer lowerCount) void
setMaxResults
(Integer maxResults) The max number of records from the datastore to return.void
setNonCountAdditionalFilterMappings
(List<FilterMapping> nonCountAdditionalFilterMappings) void
setPresentationFetch
(Boolean presentationFetch) void
setUpperCount
(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 aFilterAndSortCriteria
instance. Contains information about which records are retrieved and in what direction they're sorted.- Parameters:
criteria
-FilterAndSortCriteria
-
addAll
Add allFilterAndSortCriteria
instances. Contains information about which records are retrieved and in what direction they're sorted.- Parameters:
criterias
- the list ofFilterAndSortCriteria
instances to add
-
getCriteriaMap
Retrieve the addedFilterAndSortCriteria
instances organized into a map- Returns:
- the
FilterAndSortCriteria
instances 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 whilefolderLookup
is true, this means find entities not assigned to a folder.- Returns:
- the folder ID
-
setFolderId
-