Interface SpiOrmQueryRequest<T>

All Superinterfaces:
BeanQueryRequest<T>
All Known Implementing Classes:
OrmQueryRequest

public interface SpiOrmQueryRequest<T> extends BeanQueryRequest<T>
Defines the ORM query request api.
  • Method Details

    • query

      SpiQuery<T> query()
      Return the query.
      Specified by:
      query in interface BeanQueryRequest<T>
    • descriptor

      BeanDescriptor<T> descriptor()
      Return the associated BeanDescriptor.
    • prepareQuery

      void prepareQuery()
      Prepare the query for execution.
    • initTransIfRequired

      void initTransIfRequired()
      This will create a local (readOnly) transaction if no current transaction exists.

      A transaction may have been passed in explicitly or currently be active in the thread local. If not, then a readOnly transaction is created to execute this query.

    • endTransIfRequired

      void endTransIfRequired()
      Will end a locally created transaction.

      It ends the transaction by using a rollback() as the transaction is known to be readOnly.

    • delete

      int delete()
      Execute the query as a delete.
    • update

      int update()
      Execute the query as a update.
    • findId

      Object findId()
      Execute the query as findById.
    • findCount

      int findCount()
      Execute the find row count query.
    • findIds

      <A> List<A> findIds()
      Execute the find ids query.
    • findEach

      void findEach(Consumer<T> consumer)
      Execute findEach iterating results one bean at a time.
    • findEach

      void findEach(int batch, Consumer<List<T>> batchConsumer)
      Execute findEach with a batch consumer.
    • findEachWhile

      void findEachWhile(Predicate<T> consumer)
      Execute the find returning a QueryIterator and visitor pattern.
    • findIterate

      QueryIterator<T> findIterate()
      Execute the find returning a QueryIterator.
    • findVersions

      List<Version<T>> findVersions()
      Execute the finVersions() query.
    • findList

      List<T> findList()
      Execute the query as findList.
    • findSet

      Set<T> findSet()
      Execute the query as findSet.
    • findMap

      <K> Map<K,T> findMap()
      Execute the query as findMap.
    • findSingleAttributeCollection

      <A extends Collection<?>> A findSingleAttributeCollection(A collection)
      Execute the findSingleAttributeCollection query.
    • findResultSet

      SpiResultSet findResultSet()
      Execute returning the ResultSet.
    • getFromQueryCache

      <A> A getFromQueryCache()
      Try to get the query result from the query cache.
    • getFromBeanCache

      boolean getFromBeanCache()
      Maybe hit the bean cache returning true if everything was obtained from the cache (that there were no misses).

      Do this for findList() on many natural keys or many Ids.

    • beanCacheHits

      List<T> beanCacheHits()
      Return the bean cache hits (when all hits / no misses).
    • beanCacheHitsAsMap

      <K> Map<K,T> beanCacheHitsAsMap()
      Return the bean cache hits for findMap (when all hits / no misses).
    • beanCacheHitsAsSet

      Set<T> beanCacheHitsAsSet()
      Return the bean cache hits for findMap (when all hits / no misses).
    • resetBeanCacheAutoMode

      void resetBeanCacheAutoMode(boolean findOne)
      Reset Bean cache mode AUTO - require explicit setting for bean cache use with findList().
    • dbLikeClause

      String dbLikeClause(boolean rawLikeExpression)
      Return the Database platform like clause.
    • escapeLikeString

      String escapeLikeString(String value)
      Escapes a string to use it as exact match in Like clause.
    • markNotQueryOnly

      void markNotQueryOnly()
      Mark the underlying transaction as not being query only.
    • isDeleteByStatement

      boolean isDeleteByStatement()
      Return true if delete by statement is allowed for this type given cascade rules etc.
    • isGetAllFromBeanCache

      boolean isGetAllFromBeanCache()
      Return true if hitting bean cache and returning all beans from cache.