Package org.hibernate.jdbc
Class WorkExecutor<T>
- java.lang.Object
-
- org.hibernate.jdbc.WorkExecutor<T>
-
public class WorkExecutor<T> extends Object
A visitor used for executing a discrete piece of work encapsulated in aWorkorReturningWorkinstance.
-
-
Constructor Summary
Constructors Constructor Description WorkExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TexecuteReturningWork(ReturningWork<T> work, Connection connection)Execute the discrete work encapsulated by aReturningWorkinstance using the supplied connection, returning the result ofReturningWork.execute(Connection).@Nullable TexecuteWork(Work work, Connection connection)Execute the discrete work encapsulated by aWorkinstance using the supplied connection.
-
-
-
Method Detail
-
executeWork
public @Nullable T executeWork(Work work, Connection connection) throws SQLException
Execute the discrete work encapsulated by aWorkinstance using the supplied connection.Because
Workdoes not return a value when executed viaWork.execute(Connection), this method always returns null.- Parameters:
work- TheReturningWorkinstance encapsulating the discrete workconnection- The connection on which to perform the work.- Returns:
- null.
- Throws:
SQLException- Thrown during execution of the underlying JDBC interaction.HibernateException- Generally indicates a wrapped SQLException.
-
executeReturningWork
public T executeReturningWork(ReturningWork<T> work, Connection connection) throws SQLException
Execute the discrete work encapsulated by aReturningWorkinstance using the supplied connection, returning the result ofReturningWork.execute(Connection).- Parameters:
work- TheReturningWorkinstance encapsulating the discrete workconnection- The connection on which to perform the work.- Returns:
- the valued returned by
work.execute(connection). - Throws:
SQLException- Thrown during execution of the underlying JDBC interaction.HibernateException- Generally indicates a wrapped SQLException.
-
-