Package com.querydsl.sql
Class SQLListeners
java.lang.Object
com.querydsl.sql.SQLListeners
- All Implemented Interfaces:
SQLDetailedListener,SQLListener
SQLListeners is a SQLListener implementation which dispatches the
notifications to a list of SQLListener instances- Author:
- tiwe
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(SQLListener listener) voidend(SQLListenerContext context) Called at the end of a query.voidexception(SQLListenerContext context) Called if an exception happens during query building and execution.voidexecuted(SQLListenerContext context) Called at the end ofPreparedStatementexecution.voidnotifyDelete(RelationalPath<?> entity, QueryMetadata md) Notify about a deletionvoidnotifyDeletes(RelationalPath<?> entity, List<QueryMetadata> batches) Notify about a batch deletionvoidnotifyInsert(RelationalPath<?> entity, QueryMetadata md, List<Path<?>> columns, List<Expression<?>> values, SubQueryExpression<?> subQuery) Notify about an insertionvoidnotifyInserts(RelationalPath<?> entity, QueryMetadata md, List<SQLInsertBatch> batches) Notify about a batch insertionvoidnotifyMerge(RelationalPath<?> entity, QueryMetadata md, List<Path<?>> keys, List<Path<?>> columns, List<Expression<?>> values, SubQueryExpression<?> subQuery) Notify about a mergevoidnotifyMerges(RelationalPath<?> entity, QueryMetadata md, List<SQLMergeBatch> batches) Notify about a batch mergevoidNotify about a queryvoidnotifyUpdate(RelationalPath<?> entity, QueryMetadata md, Map<Path<?>, Expression<?>> updates) Notify about an update operationvoidnotifyUpdates(RelationalPath<?> entity, List<SQLUpdateBatch> batches) Notify about a batch updatevoidpreExecute(SQLListenerContext context) Called at the start ofPreparedStatementexecution.voidprepared(SQLListenerContext context) Called at the end ofPreparedStatementpreparation.voidprePrepare(SQLListenerContext context) Called at the start ofPreparedStatementpreparation.voidpreRender(SQLListenerContext context) Called at the start of SQL rendering.voidrendered(SQLListenerContext context) Called at the end of SQL rendering.voidstart(SQLListenerContext context) Called at the start of a query.
-
Constructor Details
-
SQLListeners
-
SQLListeners
public SQLListeners()
-
-
Method Details
-
add
-
notifyQuery
Description copied from interface:SQLListenerNotify about a query- Specified by:
notifyQueryin interfaceSQLListener- Parameters:
md- metadata of the query
-
notifyDelete
Description copied from interface:SQLListenerNotify about a deletion- Specified by:
notifyDeletein interfaceSQLListener- Parameters:
entity- table to be deleted frommd- metadata of deletion
-
notifyDeletes
Description copied from interface:SQLListenerNotify about a batch deletion- Specified by:
notifyDeletesin interfaceSQLListener- Parameters:
entity- table to be deleted frombatches- metadata of batches
-
notifyMerge
public void notifyMerge(RelationalPath<?> entity, QueryMetadata md, List<Path<?>> keys, List<Path<?>> columns, List<Expression<?>> values, SubQueryExpression<?> subQuery) Description copied from interface:SQLListenerNotify about a merge- Specified by:
notifyMergein interfaceSQLListener- Parameters:
entity- table to be mergedmd- metadata of mergekeys- key columnscolumns- columns to be updated/insertedvalues- valuessubQuery- optional sub query
-
notifyMerges
Description copied from interface:SQLListenerNotify about a batch merge- Specified by:
notifyMergesin interfaceSQLListener- Parameters:
entity- table to be mergedmd- metadata of mergebatches- metadata of batches
-
notifyInsert
public void notifyInsert(RelationalPath<?> entity, QueryMetadata md, List<Path<?>> columns, List<Expression<?>> values, SubQueryExpression<?> subQuery) Description copied from interface:SQLListenerNotify about an insertion- Specified by:
notifyInsertin interfaceSQLListener- Parameters:
entity- table to be inserted intomd- metadata of insertioncolumns- columns to be inserted intovalues- values to be inserted intosubQuery- optional sub query
-
notifyInserts
Description copied from interface:SQLListenerNotify about a batch insertion- Specified by:
notifyInsertsin interfaceSQLListener- Parameters:
entity- table to be inserted intomd- metadata of insertionbatches- metadata of batches
-
notifyUpdate
public void notifyUpdate(RelationalPath<?> entity, QueryMetadata md, Map<Path<?>, Expression<?>> updates) Description copied from interface:SQLListenerNotify about an update operation- Specified by:
notifyUpdatein interfaceSQLListener- Parameters:
entity- table to be updatedmd- metadata of updateupdates- metadata of batches
-
notifyUpdates
Description copied from interface:SQLListenerNotify about a batch update- Specified by:
notifyUpdatesin interfaceSQLListener- Parameters:
entity- table to be updatedbatches- metadata of batches
-
start
Description copied from interface:SQLDetailedListenerCalled at the start of a query. Most context parameters are empty at this stage- Specified by:
startin interfaceSQLDetailedListener- Parameters:
context- a context object that is progressively filled out as the query executes
-
preRender
Description copied from interface:SQLDetailedListenerCalled at the start of SQL rendering.- Specified by:
preRenderin interfaceSQLDetailedListener- Parameters:
context- a context object that is progressively filled out as the query executes
-
rendered
Description copied from interface:SQLDetailedListenerCalled at the end of SQL rendering. The sql context value will not be available- Specified by:
renderedin interfaceSQLDetailedListener- Parameters:
context- a context object that is progressively filled out as the query executes
-
prePrepare
Description copied from interface:SQLDetailedListenerCalled at the start ofPreparedStatementpreparation.- Specified by:
prePreparein interfaceSQLDetailedListener- Parameters:
context- a context object that is progressively filled out as the query executes
-
prepared
Description copied from interface:SQLDetailedListenerCalled at the end ofPreparedStatementpreparation.- Specified by:
preparedin interfaceSQLDetailedListener- Parameters:
context- a context object that is progressively filled out as the query executes
-
preExecute
Description copied from interface:SQLDetailedListenerCalled at the start ofPreparedStatementexecution.- Specified by:
preExecutein interfaceSQLDetailedListener- Parameters:
context- a context object that is progressively filled out as the query executes
-
executed
Description copied from interface:SQLDetailedListenerCalled at the end ofPreparedStatementexecution.- Specified by:
executedin interfaceSQLDetailedListener- Parameters:
context- a context object that is progressively filled out as the query executes
-
end
Description copied from interface:SQLDetailedListenerCalled at the end of a query.- Specified by:
endin interfaceSQLDetailedListener- Parameters:
context- a context object that is progressively filled out as the query executes
-
exception
Description copied from interface:SQLDetailedListenerCalled if an exception happens during query building and execution. The context exception values will now be available indicating the exception that occurred.- Specified by:
exceptionin interfaceSQLDetailedListener- Parameters:
context- a context object that is progressively filled out as the query executes
-
getListeners
-