Package org.hibernate.jdbc
Class AbstractReturningWork<T>
- java.lang.Object
-
- 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 ofReturningWork
that accepts aWorkExecutor
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
Constructors Constructor Description AbstractReturningWork()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
accept(WorkExecutor<T> executor, Connection connection)
Accepts aWorkExecutor
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
-
-
-
-
Method Detail
-
accept
public T accept(WorkExecutor<T> executor, Connection connection) throws SQLException
Accepts aWorkExecutor
visitor for executing the discrete work encapsulated by this work instance using the supplied connection.- Specified by:
accept
in interfaceWorkExecutorVisitable<T>
- Parameters:
executor
- The visitor that executes the workconnection
- The connection on which to perform the work.- Returns:
- the valued returned by
ReturningWork.execute(Connection)
. - Throws:
SQLException
- Thrown during execution of the underlying JDBC interaction.HibernateException
- Generally indicates a wrapped SQLException.
-
-