java.lang.Object
org.jooq.impl.DefaultVisitListener
- All Implemented Interfaces:
EventListener
,VisitListener
A publicly available default implementation of
VisitListener
.
Use this to stay compatible with future API changes (i.e. added methods to
VisitListener
)
- Author:
- Lukas Eder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clauseEnd
(VisitContext context) Called after leaving aClause
.void
clauseStart
(VisitContext context) Called before entering aClause
.void
visitEnd
(VisitContext context) Called after visiting aQueryPart
.void
visitStart
(VisitContext context) Called before visiting aQueryPart
.
-
Constructor Details
-
DefaultVisitListener
public DefaultVisitListener()
-
-
Method Details
-
clauseStart
Description copied from interface:VisitListener
Called before entering aClause
.- Specified by:
clauseStart
in interfaceVisitListener
- See Also:
-
clauseEnd
Description copied from interface:VisitListener
Called after leaving aClause
.- Specified by:
clauseEnd
in interfaceVisitListener
- See Also:
-
visitStart
Description copied from interface:VisitListener
Called before visiting aQueryPart
.Certain
VisitListener
implementations may chose to replace theQueryPart
contained in the argumentVisitContext
throughVisitContext.queryPart(QueryPart)
. This can be used for many use-cases, for example to add aCHECK OPTION
to an OracleINSERT
statement:
The above SQL transformation allows to prevent inserting new books for authors other than those with-- Original query INSERT INTO book (id, author_id, title) VALUES (10, 15, '1984') -- Transformed query INSERT INTO ( SELECT * FROM book WHERE author_id IN (1, 2, 3) WITH CHECK OPTION ) (id, author_id, title) VALUES (10, 15, '1984')
author_id IN (1, 2, 3)
- Specified by:
visitStart
in interfaceVisitListener
- See Also:
-
visitEnd
Description copied from interface:VisitListener
Called after visiting aQueryPart
.- Specified by:
visitEnd
in interfaceVisitListener
- See Also:
-