com.holonplatform.core.query.lock

## Interface LockQuery

- All Superinterfaces:
    DatastoreCommodity, DataTarget.DataTargetSupport<LockQuery>, ExpressionResolver.ExpressionResolverBuilder<LockQuery>, LockSupport<LockQuery>, QueryAggregation.QueryAggregationSupport<LockQuery>, QueryBuilder<LockQuery>, QueryFilter.QueryFilterSupport<LockQuery>, QueryProjectionOperations<Stream,List,Optional,Long>, QueryResults, QuerySort.QuerySortSupport<LockQuery>, Serializable

      public interface LockQuery
      extends QueryBuilder<LockQuery>, QueryResults, DatastoreCommodity, LockSupport<LockQuery>

  A query with locking support, which is available through the `LockSupport` API.
  Since:
    5.2.0
  See Also:
    `LockSupport`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.query.QueryResults

      `QueryResults.QueryNonUniqueResultException`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `<R> Stream<R>` | `stream(QueryProjection<R> projection)` Execute query and get a `Stream` of query results using given `projection` to map results to required type.

    - ### Methods inherited from interface com.holonplatform.core.query.QueryBuilder

      `distinct, getQueryConfiguration, limit, offset, parameter, parameter, restrict`

    - ### Methods inherited from interface com.holonplatform.core.query.QueryFilter.QueryFilterSupport

      `filter, filter, filter`

    - ### Methods inherited from interface com.holonplatform.core.query.QuerySort.QuerySortSupport

      `sort, sort, sort`

    - ### Methods inherited from interface com.holonplatform.core.datastore.DataTarget.DataTargetSupport

      `target, target`

    - ### Methods inherited from interface com.holonplatform.core.query.QueryAggregation.QueryAggregationSupport

      `aggregate, aggregate, aggregate`

    - ### Methods inherited from interface com.holonplatform.core.ExpressionResolver.ExpressionResolverBuilder

      `withExpressionResolver`

    - ### Methods inherited from interface com.holonplatform.core.query.QueryResults

      `count, countAll, findOne, findOne, findOne, list, list, list, stream, stream`

    - ### Methods inherited from interface com.holonplatform.core.query.lock.LockSupport

      `lock, lock, lock, lock, tryLock, tryLock, tryLock, tryLock`

- - ### Method Detail

    - #### stream

          <R> Stream<R> stream(QueryProjection<R> projection)

      Execute query and get a `Stream` of query results using given `projection` to map results to required type.
      Specified by:
        `stream` in interface `QueryProjectionOperations<Stream,List,Optional,Long>`
      Specified by:
        `stream` in interface `QueryResults`
      Type Parameters:
        `R` - Results type
      Parameters:
        `projection` - Query projection (not null)
      Returns:
        Query results stream, an empty Stream if none
      Throws:
        `LockAcquisitionException` - If a lock mode was configured and the lock can't be acquired
        `DataAccessException` - Error in query execution

Copyright © 2019 The Holon Platform. All rights reserved.