Package org.hibernate.jdbc
Class WorkExecutor<T>
java.lang.Object
org.hibernate.jdbc.WorkExecutor<T>
A visitor used for executing a discrete piece of work encapsulated in a
Work
or ReturningWork
instance.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecuteReturningWork
(ReturningWork<T> work, Connection connection) Execute the discrete work encapsulated by aReturningWork
instance using the supplied connection, returning the result ofReturningWork.execute(Connection)
.@Nullable T
executeWork
(Work work, Connection connection) Execute the discrete work encapsulated by aWork
instance using the supplied connection.
-
Constructor Details
-
WorkExecutor
public WorkExecutor()
-
-
Method Details
-
executeWork
Execute the discrete work encapsulated by aWork
instance using the supplied connection.Because
Work
does not return a value when executed viaWork.execute(Connection)
, this method always returns null.- Parameters:
work
- TheReturningWork
instance 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
Execute the discrete work encapsulated by aReturningWork
instance using the supplied connection, returning the result ofReturningWork.execute(Connection)
.- Parameters:
work
- TheReturningWork
instance 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.
-