Package org.hibernate.jdbc
Class AbstractReturningWork<T>
- java.lang.Object
- org.hibernate.jdbc.AbstractReturningWork<T>
- All Implemented Interfaces:
ReturningWork<T>,WorkExecutorVisitable<T>
public abstract classAbstractReturningWork<T>extendsObjectimplementsReturningWork<T>,WorkExecutorVisitable<T>
An abstract implementation ofReturningWorkthat accepts aWorkExecutorvisitor 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 Taccept(WorkExecutor<T> executor,Connection connection)Accepts aWorkExecutorvisitor 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) throwsSQLException
Accepts aWorkExecutorvisitor for executing the discrete work encapsulated by this work instance using the supplied connection.- Specified by:
acceptin 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.