Package org.hibernate.jdbc
Defines the notion of a unit of JDBC work that may be executed by the session
at the request of the client.
Execution of a unit of work may be requested by calling
SharedSessionContract.doWork(org.hibernate.jdbc.Work)
or
SharedSessionContract.doReturningWork(org.hibernate.jdbc.ReturningWork)
.
For example:
session.doWork(connection -> { try ( PreparedStatement ps = connection.prepareStatement( " ... " ) ) { ps.execute(); } });
- See Also:
Work
,ReturningWork
,Expectation
-
Interface Summary Interface Description Expectation Defines an expected DML operation outcome.ReturningWork<T> A discrete piece of work making use of a JDBC connection and returning a result.Work A discrete piece of work making use of a JDBC connection.WorkExecutorVisitable<T> This interface provides a way to execute unrelated "work" objects using polymorphism. -
Class Summary Class Description AbstractReturningWork<T> An abstract implementation ofReturningWork
that accepts aWorkExecutor
visitor for executing a discrete piece of work and returning a result.AbstractWork An abstract implementation ofWork
that accepts aWorkExecutor
visitor for executing a discrete piece of work.Expectations Holds various often usedExpectation
definitions.Expectations.BasicExpectation Expectations.BasicParamExpectation WorkExecutor<T> A visitor used for executing a discrete piece of work encapsulated in aWork
orReturningWork
instance. -
Exception Summary Exception Description BatchedTooManyRowsAffectedException Much likeTooManyRowsAffectedException
, indicates that more rows than what we were expecting were affected.BatchFailedException Indicates a failed batch entry (-3 return).TooManyRowsAffectedException Indicates that more rows were affected then we were expecting to be.