public interface Context<C extends Context<C>>
BindContext
,
RenderContext
Modifier and Type | Method and Description |
---|---|
Configuration |
configuration()
The configuration wrapped by this context.
|
Map<Object,Object> |
data()
Get all custom data from this
Context . |
Object |
data(Object key)
Get some custom data from this
Context . |
Object |
data(Object key,
Object value)
Set some custom data to this
Context . |
boolean |
declareFields()
Whether the current context is rendering a SQL field declaration (e.g. a
Field in the SELECT clause of the query). |
C |
declareFields(boolean declareFields)
Set the new context value for
declareFields() |
boolean |
declareTables()
Whether the current context is rendering a SQL table declaration (e.g. a
Table in the FROM or JOIN clause of the
query). |
C |
declareTables(boolean declareTables)
Set the new context value for
declareTables() |
boolean |
declareWindows()
Whether the current context is rendering a SQL window declaration (e.g. a
WindowDefinition in the WINDOW clause of the query). |
C |
declareWindows(boolean declareWindows)
Set the new context value for
declareWindows() |
C |
end(Clause clause) |
int |
nextIndex()
Get the next bind index.
|
int |
peekIndex()
Peek the next bind index.
|
C |
start(Clause clause)
TODO [#2667]
Properties of these methods:
- A clause is always started / ended, even if it isn't rendered or if it's empty!
|
boolean |
subquery()
Whether the current context is rendering a sub-query (nested query)
|
C |
subquery(boolean subquery)
Set the new context value for
subquery() |
C |
visit(QueryPart part)
Visit a
QueryPart in the current Context . |
Configuration configuration()
Map<Object,Object> data()
Context
.
This is custom data that was previously set to the context using
data(Object, Object)
. Use custom data if you want to pass data
to QueryPart
objects for a given RenderContext
or
BindContext
.
Unlike Configuration.data()
, these data's lifecycle only
matches that of a render or bind context.
null
Object data(Object key)
Context
.
This is custom data that was previously set to the context using
data(Object, Object)
. Use custom data if you want to pass data
to QueryPart
objects for a given RenderContext
or
BindContext
.
Unlike Configuration.data()
, these data's lifecycle only
matches that of a render or bind context.
key
- A key to identify the custom datanull
if no such data is contained
in this ExecuteContext
ExecuteListener
Object data(Object key, Object value)
Context
.
This is custom data that was previously set to the context using
data(Object, Object)
. Use custom data if you want to pass data
to QueryPart
objects for a given RenderContext
or
BindContext
.
Unlike Configuration.data()
, these data's lifecycle only
matches that of a render or bind context.
key
- A key to identify the custom datavalue
- The custom datanull
if no data
was previously set for the given keyExecuteListener
C visit(QueryPart part) throws DataAccessException
QueryPart
in the current Context
.
This method is called by certain QueryPart
implementations
to recursively visit component QueryPart
s.
part
- The component QueryPart
DataAccessException
- If something went wrong while visiting the
component QueryPart
, e.g. when binding a
variableC start(Clause clause)
boolean declareFields()
Field
in the SELECT
clause of the query).C declareFields(boolean declareFields)
declareFields()
boolean declareTables()
Table
in the FROM
or JOIN
clause of the
query).C declareTables(boolean declareTables)
declareTables()
boolean declareWindows()
WindowDefinition
in the WINDOW
clause of the query).C declareWindows(boolean declareWindows)
declareWindows()
boolean subquery()
C subquery(boolean subquery)
subquery()
int nextIndex()
PreparedStatement
. Client code
must assure that calling nextIndex()
is followed by setting a
bind value to BindContext.statement()
RenderContext.paramType()
being to NAMED
int peekIndex()
nextIndex()
Copyright © 2014. All Rights Reserved.