com.h3c.util.dao

## Class WriteQuery<T>

- java.lang.Object
- - com.h3c.util.dao.WriteQuery<T>

- Type Parameters:
    `T` - type of the transaction result.
  Direct Known Subclasses:
    DaoAddQuery, DaoDeleteQuery, DaoDeleteTransportableQuery, DaoTryAddQuery, DaoUpdateDependentQuery, DaoUpdateQuery

      public abstract class WriteQuery<T>
      extends Object

  Data store transaction. Intended for operations that will write to the data persistence layer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WriteQuery()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract T` | `execute(DataStoreContext context)` Executes the query.
    `T` | `execute(DataStoreContext context, org.slf4j.Logger log)` Executes the transaction.

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

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

- - ### Constructor Detail

    - #### WriteQuery

          public WriteQuery()

  - ### Method Detail

    - #### execute

          public T execute(DataStoreContext context,
                  org.slf4j.Logger log)
                    throws Exception

      Executes the transaction.
      Parameters:
        `context` - data store context.
        `log` - logger to use.
      Returns:
        the result of the query.
      Throws:
        `Exception` - if any error occurs during query execution

    - #### execute

          protected abstract T execute(DataStoreContext context)

      Executes the query.
      Parameters:
        `context` - data store context.
      Returns:
        the result of the query.

Copyright © 2014. All Rights Reserved.