public class WorkExecutor<T>
extends java.lang.Object
Work
or ReturningWork
instance..Constructor and Description |
---|
WorkExecutor() |
Modifier and Type | Method and Description |
---|---|
<T> T |
executeReturningWork(ReturningWork<T> work,
java.sql.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,
java.sql.Connection connection)
Execute the discrete work encapsulated by a
Work instance
using the supplied connection. |
public <T> T executeWork(Work work, java.sql.Connection connection) throws java.sql.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.java.sql.SQLException
- Thrown during execution of the underlying JDBC interaction.HibernateException
- Generally indicates a wrapped SQLException.public <T> T executeReturningWork(ReturningWork<T> work, java.sql.Connection connection) throws java.sql.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)
.java.sql.SQLException
- Thrown during execution of the underlying JDBC interaction.HibernateException
- Generally indicates a wrapped SQLException.Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.