public class WorkExecutor<T> extends Object
Work
or ReturningWork
instance..Constructor and Description |
---|
WorkExecutor() |
Modifier and Type | Method and Description |
---|---|
<T> T |
executeReturningWork(ReturningWork<T> work,
Connection connection)
Execute the discrete work encapsulated by a
ReturningWork instance
using the supplied connection, returning the result of
ReturningWork.execute(java.sql.Connection) |
<T> T |
executeWork(Work work,
Connection connection)
Execute the discrete work encapsulated by a
Work instance
using the supplied connection. |
public <T> T executeWork(Work work, Connection connection) throws SQLException
Work
instance
using the supplied connection.
Because Work
does not return a value when executed
(via Work.execute(java.sql.Connection)
, this method
always returns null.work
- The @link ReturningWork} instance encapsulating the discrete workconnection
- The connection on which to perform the work.SQLException
- Thrown during execution of the underlying JDBC interaction.HibernateException
- Generally indicates a wrapped SQLException.public <T> T executeReturningWork(ReturningWork<T> work, Connection connection) throws SQLException
ReturningWork
instance
using the supplied connection, returning the result of
ReturningWork.execute(java.sql.Connection)
work
- The @link ReturningWork} instance encapsulating the discrete workconnection
- The connection on which to perform the work.work.execute(connection)
.SQLException
- Thrown during execution of the underlying JDBC interaction.HibernateException
- Generally indicates a wrapped SQLException.Copyright © 2001-2017 Red Hat, Inc. All Rights Reserved.