org.qi4j.spi.query
Interface EntityFinder

All Known Subinterfaces:
ElasticSearchFinder, ESClusterIndexQueryService, ESFilesystemIndexQueryService, ESMemoryIndexQueryService, PostgreSQLService, RdfIndexingEngineService, RdfQueryService, SolrQueryService, SQLIndexingEngineService
All Known Implementing Classes:
ElasticSearchFinder.Mixin, RdfQueryService.RdfEntityFinderMixin, SolrEntityIndexerMixin, SolrEntityQueryMixin, SQLEntityFinder

public interface EntityFinder

Entity Finder.


Method Summary
 long countEntities(java.lang.Class<?> resultType, Specification<Composite> whereClause, java.util.Map<java.lang.String,java.lang.Object> variables)
          Count entities matching the query criterion.
 java.lang.Iterable<EntityReference> findEntities(java.lang.Class<?> resultType, Specification<Composite> whereClause, OrderBy[] orderBySegments, java.lang.Integer firstResult, java.lang.Integer maxResults, java.util.Map<java.lang.String,java.lang.Object> variables)
          Find entities matching the query criterion.
 EntityReference findEntity(java.lang.Class<?> resultType, Specification<Composite> whereClause, java.util.Map<java.lang.String,java.lang.Object> variables)
          Find a single entity matching the query criterion.
 

Method Detail

findEntities

java.lang.Iterable<EntityReference> findEntities(java.lang.Class<?> resultType,
                                                 @Optional
                                                 Specification<Composite> whereClause,
                                                 @Optional
                                                 OrderBy[] orderBySegments,
                                                 @Optional
                                                 java.lang.Integer firstResult,
                                                 @Optional
                                                 java.lang.Integer maxResults,
                                                 java.util.Map<java.lang.String,java.lang.Object> variables)
                                                 throws EntityFinderException
Find entities matching the query criterion.

Parameters:
resultType - Type that the entities must have.
whereClause - Where clause specification.
orderBySegments - Ordering
firstResult - Index of the first returned entity.
maxResults - Maximum returned entities.
variables - Query variables
Returns:
Single entity matching the query criterion.
Throws:
EntityFinderException

findEntity

EntityReference findEntity(java.lang.Class<?> resultType,
                           @Optional
                           Specification<Composite> whereClause,
                           java.util.Map<java.lang.String,java.lang.Object> variables)
                           throws EntityFinderException
Find a single entity matching the query criterion.

Parameters:
resultType - Type that the entity must have.
whereClause - Where clause specification.
variables - Query variables
Returns:
Single entity matching the query criterion.
Throws:
EntityFinderException

countEntities

long countEntities(java.lang.Class<?> resultType,
                   @Optional
                   Specification<Composite> whereClause,
                   java.util.Map<java.lang.String,java.lang.Object> variables)
                   throws EntityFinderException
Count entities matching the query criterion.

Parameters:
resultType - Type that the entities must have.
whereClause - Where clause specification.
variables - Query variables
Returns:
Count entities matching the query criterion.
Throws:
EntityFinderException