Interface StatementObserver
- All Superinterfaces:
EntityAgent.CreationOption, EntityManager.CreationOption
@Incubating
public interface StatementObserver
extends EntityManager.CreationOption, EntityAgent.CreationOption
Observation of (almost) all JDBC statements performed by Hibernate.
Generally "performed" means calls to Statement.execute(String), Statement.executeQuery(String)
or Statement.executeUpdate(String). In these cases, performingSql(String, int) is called with -1 as the
batchPosition.
In JDBC batching cases, performingSql(String, int) is called for each Statement.addBatch(String) call. In these
cases, batchPosition is the addition's position within the current batch.
- Since:
- 8.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidperformingSql(String sql, int batchPosition) Callback that the givensqlis about to be performed.
-
Method Details
-
performingSql
Callback that the givensqlis about to be performed.- Parameters:
sql- The SQL which is being performed.batchPosition- The position within a batch;-1if not batched.- API Note:
- "Performed" here could mean immediately executed, or added to a JDBC batch.
-