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

public interface FilteringVoEnabledDao<O extends Identifiable, VO extends IdentifiableValueObject<O>> extends BaseVoEnabledDao<O,VO>, FilteringDao<O>
Interface for VO-enabled DAO with filtering capabilities.
Author:
poirigui
  • Method Details

    • loadValueObjects

      Slice<VO> loadValueObjects(@Nullable Filters filters, @Nullable Sort sort, int offset, int limit)
      Load VOs with ordering, filtering and offset/limit.

      Consider using FilteringDao.getFilter(String, Filter.Operator, String) and FilteringDao.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 the Filter must 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 ignore
      limit - a limit on the number of returned results, or -1 to ignore
      Returns:
      a slice of the relevant data
      See Also:
    • loadValueObjects

      List<VO> loadValueObjects(@Nullable Filters filters, @Nullable Sort sort)
      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 Sort must 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 cursor is null, the page returned is the first page in the sort order, with a non-null CursorPage.getNextCursor() if more rows exist.

      Parameters:
      filters - filters applied on the search; same shape as loadValueObjects(Filters, Sort, int, int)
      sort - deterministic sort (must end in a unique key); must not be null for cursor mode
      cursor - the cursor token decoded from a previous response, or null to fetch the first page
      limit - page size; the implementation fetches one additional row internally to detect whether a next page exists, but the returned page contains at most limit rows
      Returns:
      a CursorPage with the rows, the nextCursor (or null at the end of the collection), prevCursor (when known), and a totalElements of null (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