com.h3c.util.persistence.cassandra.query

## Class TransWriteQueryDecorator<T extends TransportObject<? super T,?>>

- java.lang.Object
- - com.h3c.util.persistence.cassandra.query.WriteQueryDecorator<T,DataStoreContext>
  - - com.h3c.util.persistence.cassandra.query.TransWriteQueryDecorator<T>

- Type Parameters:
    `T` - Type of the result of the query.
  All Implemented Interfaces:
    WriteQuery<T,DataStoreContext>

      public class TransWriteQueryDecorator<T extends TransportObject<? super T,?>>
      extends WriteQueryDecorator<T,DataStoreContext>

  TransWriteQueryDecorator is a concrete decorator for the write query.
  This decorator provides the ability to lock the rows that are being written to the persistence layer until the operation is finished.
  This decorator assumes that the read all operation is not transaction based.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TransWriteQueryDecorator(WriteQuery<T,DataStoreContext> update)` Constructor for Write Query Decorator with locks.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `execute(DataStoreContext context)` This is the single execute method provided by the WriteQuery interface.

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

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

- - ### Constructor Detail

    - #### TransWriteQueryDecorator

          public TransWriteQueryDecorator(WriteQuery<T,DataStoreContext> update)

      Constructor for Write Query Decorator with locks. Logging is not provided here. If the query needs logging, it has to be decorated separately.
      Parameters:
        `update` - The write query to be executed. This can be an already decorated query.

  - ### Method Detail

    - #### execute

          public T execute(DataStoreContext context)
                                                         throws Exception

      Description copied from interface: `WriteQuery`
      This is the single execute method provided by the WriteQuery interface. The application/business logic prepares a write query and as the last step, calls this method to transmit data to the underlying tiers. This data is persisted using DAO and Entity Manager.
      Parameters:
        `context` - - The DataStore context. Provides the context to the query.
      Returns:
        Transport object that has been persisted/deleted.
      Throws:
        `Exception`

Copyright © 2014. All Rights Reserved.