com.h3c.util.persistence.cassandra.query

## Class UpdateQuery<T extends TransportObject<? super T,?>,P extends Storable<?>,C>

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

- Type Parameters:
    `T` - Type of the query result
    `P` - Type of the persisted object
    `C` - Context for query execution
  All Implemented Interfaces:
    WriteQuery<T,C>

      public class UpdateQuery<T extends TransportObject<? super T,?>,P extends Storable<?>,C>
      extends Object
      implements WriteQuery<T,C>

  UpdateQuery is used to update data in the persistence layer. If the data to be updated does not exist, it will be created.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UpdateQuery(T transportable, Dao<?,T,P,?,?,C> dao)` Query to update data in the database tables.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `execute(C context)` Execute the update Query

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

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

- - ### Constructor Detail

    - #### UpdateQuery

          public UpdateQuery(T transportable,
                     Dao<?,T,P,?,?,C> dao)

      Query to update data in the database tables.
      Parameters:
        `transportable` - Data in the database to be updated.
        `dao` - Dao used to execute the update query.

  - ### Method Detail

    - #### execute

          public T execute(C context)
                                                         throws Exception

      Execute the update Query
      Specified by:
        `execute` in interface `WriteQuery<T extends TransportObject<? super T,?>,C>`
      Parameters:
        `context` - context to execute the query.
      Returns:
        Result of Update 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.