org.hibernate.jdbc
Class AbstractReturningWork<T>

java.lang.Object
  extended by org.hibernate.jdbc.AbstractReturningWork<T>
All Implemented Interfaces:
ReturningWork<T>, WorkExecutorVisitable<T>

public abstract class AbstractReturningWork<T>
extends Object
implements ReturningWork<T>, WorkExecutorVisitable<T>

An abstract implementation of ReturningWork that accepts a WorkExecutor visitor for executing a discrete piece of work and returning a result. This class is intended to be used for work that returns a value when executed.


Constructor Summary
AbstractReturningWork()
           
 
Method Summary
 T accept(WorkExecutor<T> executor, Connection connection)
          Accepts a WorkExecutor visitor for executing the discrete work encapsulated by this work instance using the supplied connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hibernate.jdbc.ReturningWork
execute
 

Constructor Detail

AbstractReturningWork

public AbstractReturningWork()
Method Detail

accept

public T accept(WorkExecutor<T> executor,
                Connection connection)
         throws SQLException
Accepts a WorkExecutor visitor for executing the discrete work encapsulated by this work instance using the supplied connection.

Specified by:
accept in interface WorkExecutorVisitable<T>
Parameters:
executor - The visitor that executes the work
connection - The connection on which to perform the work.
Returns:
the valued returned by ReturningWork.execute(java.sql.Connection).
Throws:
SQLException - Thrown during execution of the underlying JDBC interaction.
HibernateException - Generally indicates a wrapped SQLException.


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.