org.hibernate.jdbc
Class AbstractReturningWork<T>
java.lang.Object
org.hibernate.jdbc.AbstractReturningWork<T>
- All Implemented Interfaces:
- ReturningWork<T>, WorkExecutorVisitable<T>
public abstract class AbstractReturningWork<T>
- extends Object
- implements ReturningWork<T>, WorkExecutorVisitable<T>
An abstract implementation of ReturningWork
that accepts a WorkExecutor
visitor for executing a discrete piece of work and returning a result.
This class is intended to be used for work that returns a value when executed.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractReturningWork
public AbstractReturningWork()
accept
public T accept(WorkExecutor<T> executor,
Connection connection)
throws SQLException
- Accepts a
WorkExecutor
visitor for executing the discrete work
encapsulated by this work instance using the supplied connection.
- Specified by:
accept
in interface WorkExecutorVisitable<T>
- Parameters:
executor
- The visitor that executes the workconnection
- The connection on which to perform the work.
- Returns:
- the valued returned by
ReturningWork.execute(java.sql.Connection)
.
- Throws:
SQLException
- Thrown during execution of the underlying JDBC interaction.
HibernateException
- Generally indicates a wrapped SQLException.
Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.