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