com.h3c.util.persistence.cassandra.query

## Class GetQuery<I extends Serializable,T extends TransportObject<? super T,I>,P extends Storable<I>,C>

- java.lang.Object
- - com.h3c.util.persistence.cassandra.query.GetQuery<I,T,P,C>

- Type Parameters:
    `I` - Type of Id for the entry to read
    `T` - Type of the TransportObject
    `P` - Type of Storable
    `C` - Type of Context to execute the query.
  All Implemented Interfaces:
    ReadQuery<T,C>

      public class GetQuery<I extends Serializable,T extends TransportObject<? super T,I>,P extends Storable<I>,C>
      extends Object
      implements ReadQuery<T,C>

  Query to read an entry from Column Family/Table in the database.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GetQuery(Id<T,I> id, Dao<I,T,P,?,?,C> dao)` Provides ability for the business logic to perform read operation.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `execute(C context)` Execute the read operation.

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

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

- - ### Constructor Detail

    - #### GetQuery

          public GetQuery(Id<T,I> id,
                  Dao<I,T,P,?,?,C> dao)

      Provides ability for the business logic to perform read operation. The applications use DAO to perform all database operations and the GetQuery provides methods that DAO can use to take the user query to the lower tiers and read the specified entry from the table/Column Family.
      Parameters:
        `id` - Id of entry to read.
        `dao` - Dao for execute the query.

  - ### Method Detail

    - #### execute

          public T execute(C context)

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

Copyright © 2014. All Rights Reserved.