Interface FilteringVoEnabledDao<O extends Identifiable, VO extends IdentifiableValueObject<O>>
- All Superinterfaces:
BaseDao<O>, BaseVoEnabledDao<O,VO>, FilteringDao<O>
- All Known Subinterfaces:
ArrayDesignDao, BioAssayDao, CachedFilteringVoEnabledDao<O,VO>, CharacteristicDao, CompositeSequenceDao, DatabaseEntryDao, ExpressionAnalysisResultSetDao, ExpressionExperimentDao, FactorValueDao, GeneDao, QuantitationTypeDao, TaxonDao
- All Known Implementing Classes:
AbstractCriteriaFilteringVoEnabledDao, AbstractCuratableDao, AbstractFilteringVoEnabledDao, AbstractNoopFilteringVoEnabledDao, AbstractQueryFilteringVoEnabledDao, ArrayDesignDaoImpl, BioAssayDaoImpl, CharacteristicDaoImpl, CompositeSequenceDaoImpl, DatabaseEntryDaoImpl, ExpressionAnalysisResultSetDaoImpl, ExpressionExperimentDaoImpl, FactorValueDaoImpl, GeneDaoImpl, QuantitationTypeDaoImpl, TaxonDaoImpl
- Author:
- poirigui
-
Nested Class Summary
Nested classes/interfaces inherited from interface FilteringDao
FilteringDao.ConjunctSpec -
Method Summary
Modifier and TypeMethodDescriptionloadValueObjects(Filters filters, Sort sort) Load VOs with minimal ordering and filtering.loadValueObjects(Filters filters, Sort sort, int offset, int limit) Load VOs with ordering, filtering and offset/limit.default CursorPage<VO> loadValueObjectsByCursor(Filters filters, Sort sort, Cursor cursor, int limit) Load VOs by keyset (cursor) pagination.Methods inherited from interface BaseDao
countAll, create, create, find, findOrCreate, getElementClass, load, load, loadAll, loadReference, loadReference, reload, reload, remove, remove, save, save, streamAll, streamAll, update, updateMethods inherited from interface BaseVoEnabledDao
loadAllValueObjects, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjectsByIdsMethods inherited from interface FilteringDao
count, getFilter, getFilter, getFilter, getFilter, getFilter, getFilter, getFilter, getFilterableProperties, getFilterablePropertyAllowedValues, getFilterablePropertyDescription, getFilterablePropertyType, getSort, isFilterablePropertyDeprecated, isFilterablePropertyUsingSubquery, load, load, loadIds
-
Method Details
-
loadValueObjects
Load VOs with ordering, filtering and offset/limit.Consider using
FilteringDao.getFilter(String, Filter.Operator, String)andFilteringDao.getSort(String, Sort.Direction, Sort.NullMode)to produce the filters and sort safely from user input.- Parameters:
filters- filters applied on the search. The properties mentioned in theFiltermust exist and be visible to Hibernate. You can use nested properties such as "curationDetails.lastUpdated".sort- an object property and direction to order by. This property must exist and be visible to Hibernate. You can use nested properties such as "curationDetails.lastUpdated".offset- an offset from which entities are retrieved when sorted according to the sort argument, or 0 to ignorelimit- a limit on the number of returned results, or -1 to ignore- Returns:
- a slice of the relevant data
- See Also:
-
loadValueObjects
Load VOs with minimal ordering and filtering.Use this as an alternative to
loadValueObjects(Filters, Sort, int, int)if you do not intend to provide pagination capabilities.- See Also:
-
loadValueObjectsByCursor
default CursorPage<VO> loadValueObjectsByCursor(@Nullable Filters filters, Sort sort, @Nullable Cursor cursor, int limit) Load VOs by keyset (cursor) pagination.Cursor pagination avoids the O(N) scan-and-discard cost of
loadValueObjects(Filters, Sort, int, int)on deep pages and is drift-resistant under concurrent inserts (a row inserted into the middle of the sorted order between two page requests will not produce duplicates or skips at the page boundary).Sort requirements. The resolved
Sortmust be deterministic, i.e. it must end with a unique key (typically the identifier property). Initial support is limited to a single sort component on the identifier property (+id/-id); compound sorts are intentionally rejected until the index audit (recce ยง5.1) has been completed for the sorting columns of interest.When
cursorisnull, the page returned is the first page in the sort order, with a non-nullCursorPage.getNextCursor()if more rows exist.- Parameters:
filters- filters applied on the search; same shape asloadValueObjects(Filters, Sort, int, int)sort- deterministic sort (must end in a unique key); must not benullfor cursor modecursor- the cursor token decoded from a previous response, ornullto fetch the first pagelimit- page size; the implementation fetches one additional row internally to detect whether a next page exists, but the returned page contains at mostlimitrows- Returns:
- a
CursorPagewith the rows, thenextCursor(ornullat the end of the collection),prevCursor(when known), and atotalElementsofnull(cursor mode does not count by default) - Throws:
UnsupportedOperationException- if the implementation does not support cursor pagination yet (e.g. criteria-based DAOs that have not been migrated)IllegalArgumentException- if the sort is not deterministic or its key shape does not match the cursor's
-