com.h3c.util.persistence.cassandra.query

## Class FindQuery<T extends TransportObject<? super T,?>,P extends Storable<?>,F,S,C>

- java.lang.Object
- - com.h3c.util.persistence.cassandra.query.FindQuery<T,P,F,S,C>

- Type Parameters:
    `T` - Type of the Query result passed to business logic
    `P` - Type of query result which incurred while dao executes the query.
    `F` - Filter to find
    `S` - Sort specification for sort the result
    `C` - Type of context to execute the query.
  All Implemented Interfaces:
    ReadQuery<List<T>,C>

      public class FindQuery<T extends TransportObject<? super T,?>,P extends Storable<?>,F,S,C>
      extends Object
      implements ReadQuery<List<T>,C>

  Finds list of entries matches the filter condition from a database table and provide the result to business logic in the given sorted order.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FindQuery(F filter, SortSpecification<S> sortSpec, Dao<?,T,P,F,S,C> dao)` Creates a find query.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<T>` | `execute(C context)` Execute the find operation.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FindQuery

          public FindQuery(F filter,
                   SortSpecification<S> sortSpec,
                   Dao<?,T,P,F,S,C> dao)

      Creates a find query.
      Parameters:
        `filter` - Filter to apply.
        `sortSpec` - Sort specification.
        `dao` - The DAO to carry out the operation.

  - ### Method Detail

    - #### execute

          public List<T> execute(C context)
                                                               throws Exception

      Execute the find operation.
      Specified by:
        `execute` in interface `ReadQuery<List<T extends TransportObject<? super T,?>>,C>`
      Parameters:
        `context` - Context to execute the query
      Returns:
        result of Find Query.
      Throws:
        `NullPointerException` - In case of context is null.
        `Exception` - Throws Exception in case of any error in query execute.

Copyright © 2014. All Rights Reserved.