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

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `countEntities(Class<?> resultType, Specification<Composite> whereClause, Map<String,Object> variables)` Count entities matching the query criterion.
    `Iterable<EntityReference>` | `findEntities(Class<?> resultType, Specification<Composite> whereClause, OrderBy[] orderBySegments, Integer firstResult, Integer maxResults, Map<String,Object> variables)` Find entities matching the query criterion.
    `EntityReference` | `findEntity(Class<?> resultType, Specification<Composite> whereClause, Map<String,Object> variables)` Find a single entity matching the query criterion.

- - ### Method Detail

    - #### findEntities

          Iterable<EntityReference> findEntities(Class<?> resultType,
                                               @Optional
                                               Specification<Composite> whereClause,
                                               @Optional
                                               OrderBy[] orderBySegments,
                                               @Optional
                                               Integer firstResult,
                                               @Optional
                                               Integer maxResults,
                                               Map<String,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(Class<?> resultType,
                                   @Optional
                                   Specification<Composite> whereClause,
                                   Map<String,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(Class<?> resultType,
                           @Optional
                           Specification<Composite> whereClause,
                           Map<String,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`