public class DefaultVisitListener extends java.lang.Object implements VisitListener
VisitListener
.
Use this to stay compatible with future API changes (i.e. added methods to
VisitListener
)
Constructor and Description |
---|
DefaultVisitListener() |
Modifier and Type | Method and Description |
---|---|
void |
clauseEnd(VisitContext context)
Called after leaving a
Clause . |
void |
clauseStart(VisitContext context)
Called before entering a
Clause . |
void |
visitEnd(VisitContext context)
Called after visiting a
QueryPart . |
void |
visitStart(VisitContext context)
Called before visiting a
QueryPart . |
public void clauseStart(VisitContext context)
VisitListener
Clause
.clauseStart
in interface VisitListener
Context.start(Clause)
public void clauseEnd(VisitContext context)
VisitListener
Clause
.clauseEnd
in interface VisitListener
Context.end(Clause)
public void visitStart(VisitContext context)
VisitListener
QueryPart
.
Certain VisitListener
implementations may chose to replace
the QueryPart
contained in the argument VisitContext
through VisitContext.queryPart(QueryPart)
. This can be used for
many use-cases, for example to add a CHECK OPTION
to an
Oracle INSERT
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)
visitStart
in interface VisitListener
Context.visit(QueryPart)
public void visitEnd(VisitContext context)
VisitListener
QueryPart
.visitEnd
in interface VisitListener
Context.visit(QueryPart)
Copyright © 2018. All Rights Reserved.