Package org.jooq.impl
Class DefaultVisitListener
- java.lang.Object
-
- org.jooq.impl.DefaultVisitListener
-
- All Implemented Interfaces:
java.util.EventListener,VisitListener
public class DefaultVisitListener extends java.lang.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 voidclauseEnd(VisitContext context)Called after leaving aClause.voidclauseStart(VisitContext context)Called before entering aClause.voidvisitEnd(VisitContext context)Called after visiting aQueryPart.voidvisitStart(VisitContext context)Called before visiting aQueryPart.
-
-
-
Method Detail
-
clauseStart
public void clauseStart(VisitContext context)
Description copied from interface:VisitListenerCalled before entering aClause.- Specified by:
clauseStartin interfaceVisitListener- See Also:
Context.start(Clause)
-
clauseEnd
public void clauseEnd(VisitContext context)
Description copied from interface:VisitListenerCalled after leaving aClause.- Specified by:
clauseEndin interfaceVisitListener- See Also:
Context.end(Clause)
-
visitStart
public void visitStart(VisitContext context)
Description copied from interface:VisitListenerCalled before visiting aQueryPart.Certain
VisitListenerimplementations may chose to replace theQueryPartcontained in the argumentVisitContextthroughVisitContext.queryPart(QueryPart). This can be used for many use-cases, for example to add aCHECK OPTIONto an OracleINSERTstatement: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:
visitStartin interfaceVisitListener- See Also:
Context.visit(QueryPart)
-
visitEnd
public void visitEnd(VisitContext context)
Description copied from interface:VisitListenerCalled after visiting aQueryPart.- Specified by:
visitEndin interfaceVisitListener- See Also:
Context.visit(QueryPart)
-
-