- java.lang.Object
-
- org.jooq.impl.DefaultVisitListener
-
- All Implemented Interfaces:
EventListener
,VisitListener
public class DefaultVisitListener extends Object implements VisitListener
A publicly available default implementation ofVisitListener
.Use this to stay compatible with future API changes (i.e. added methods to
VisitListener
)- Author:
- Lukas Eder
-
-
Constructor Summary
Constructors Constructor Description DefaultVisitListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
.
-
-
-
Method Detail
-
clauseStart
public void clauseStart(VisitContext context)
Description copied from interface:VisitListener
Called before entering aClause
.- Specified by:
clauseStart
in interfaceVisitListener
- See Also:
Context.start(Clause)
-
clauseEnd
public void clauseEnd(VisitContext context)
Description copied from interface:VisitListener
Called after leaving aClause
.- Specified by:
clauseEnd
in interfaceVisitListener
- See Also:
Context.end(Clause)
-
visitStart
public void visitStart(VisitContext context)
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:
Context.visit(QueryPart)
-
visitEnd
public void visitEnd(VisitContext context)
Description copied from interface:VisitListener
Called after visiting aQueryPart
.- Specified by:
visitEnd
in interfaceVisitListener
- See Also:
Context.visit(QueryPart)
-
-