Top Description Constructors Methods
org.hibernate.jdbc

public Class WorkExecutor<T>

extends Object
Class Inheritance
Imports
java.sql.Connection, .SQLException, org.checkerframework.checker.nullness.qual.Nullable

A visitor used for executing a discrete piece of work encapsulated in a Work or ReturningWork instance.
Author
Gail Badner

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

the valued returned by work.execute(connection).
executeReturningWork
(ReturningWork<T>
The ReturningWork instance encapsulating the discrete work
work
,
Connection
The connection on which to perform the work.
connection
)

Execute the discrete work encapsulated by a ReturningWork instance using the supplied connection, returning the result of ReturningWork#execute(Connection).

public @Nullable T

Returns:

null.
executeWork
(Work
The ReturningWork instance encapsulating the discrete work
work
,
Connection
The connection on which to perform the work.
connection
)

Execute the discrete work encapsulated by a Work instance using the supplied connection.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

WorkExecutorback to summary
public WorkExecutor()

Method Detail

executeReturningWorkback to summary
public T executeReturningWork(ReturningWork<T> work, Connection connection) throws SQLException

Execute the discrete work encapsulated by a ReturningWork instance using the supplied connection, returning the result of ReturningWork#execute(Connection).

Parameters
work:ReturningWork<T>

The ReturningWork instance encapsulating the discrete work

connection:Connection

The connection on which to perform the work.

Returns:T

the valued returned by work.execute(connection).

Exceptions
SQLException:
Thrown during execution of the underlying JDBC interaction.
HibernateException:
Generally indicates a wrapped SQLException.
executeWorkback to summary
public @Nullable T executeWork(Work work, Connection connection) throws SQLException

Execute the discrete work encapsulated by a Work instance using the supplied connection.

Because Work does not return a value when executed via Work#execute(Connection), this method always returns null.

Parameters
work:Work

The ReturningWork instance encapsulating the discrete work

connection:Connection

The connection on which to perform the work.

Returns:@Nullable T

null.

Exceptions
SQLException:
Thrown during execution of the underlying JDBC interaction.
HibernateException:
Generally indicates a wrapped SQLException.