org.jooq
Interface RenderContext

All Superinterfaces:
Configuration, Context<RenderContext>, Serializable

public interface RenderContext
extends Context<RenderContext>

The render context is used for rendering QueryPart's to SQL. A new render context is instanciated every time a Query is rendered. QueryPart's will then pass the same context to their components

This interface is for JOOQ INTERNAL USE only. Do not reference directly

Author:
Lukas Eder
See Also:
BindContext

Nested Class Summary
static class RenderContext.CastMode
          The cast mode for bind values.
 
Method Summary
 Boolean cast()
          Whether casting must be applied.
 RenderContext.CastMode castMode()
          The currently applied cast mode for bind values
 RenderContext castMode(RenderContext.CastMode mode)
          Set the new cast mode for castMode()
 RenderContext castModeSome(SQLDialect... dialects)
          Set the new cast mode to RenderContext.CastMode.SOME for a list of dialects
 RenderContext formatIndentEnd()
          Stop indenting subsequent SQL by one level (two characters), if Settings.isRenderFormatted() is set to true This is the same as calling formatIndentEnd(int) with a parameter of 2
 RenderContext formatIndentEnd(int indent)
          Stop indenting subsequent SQL by a number of characters, if Settings.isRenderFormatted() is set to true
 RenderContext formatIndentLockEnd()
          Stop indenting subsequent SQL at the same level as the current line, if Settings.isRenderFormatted() is set to true
 RenderContext formatIndentLockStart()
          Start indenting subsequent SQL at the same level as the current line, if Settings.isRenderFormatted() is set to true
 RenderContext formatIndentStart()
          Start indenting subsequent SQL by one level (two characters), if Settings.isRenderFormatted() is set to true This is the same as calling formatIndentStart(int) with a parameter of 2
 RenderContext formatIndentStart(int indent)
          Start indenting subsequent SQL by a number of characters, if Settings.isRenderFormatted() is set to true
 RenderContext formatNewLine()
          Render a new line character (only if Settings.isRenderFormatted() is set to true)
 RenderContext formatSeparator()
          Render a new line character (only if Settings.isRenderFormatted() is set to true), or a whitespace separator character otherwise
 boolean inline()
          Whether bind variables should be inlined, rather than rendered as '?'
 RenderContext inline(boolean inline)
          Set the new context value for inline()
 RenderContext keyword(String keyword)
          Append a SQL keyword to the context's contained StringBuilder Use this to have your SQL keyword rendered in RenderKeywordStyle (upper or lower case)
 RenderContext literal(String literal)
          Append some (quoted) literal to the context's contained StringBuilder
 boolean namedParams()
          Whether bind variables should be rendered as named parameters:
  :1, :2, :custom_name or as JDBC bind variables
  ?
 RenderContext namedParams(boolean renderNamedParams)
          Set the new context value for namedParams()
 String nextAlias()
          Return a new alias that is unique for the scope of one query.
 String peekAlias()
          Peek the next alias that will be generated by nextAlias()
 boolean qualify()
          Whether query parts should render qualified names or not
 RenderContext qualify(boolean qualify)
          Sett the new context value for qualify()
 String render()
          Render the context's underlying SQL statement
 String render(QueryPart part)
          Render a query part in a new context derived from this one.
 RenderContext sql(char sql)
          Append some SQL to the context's contained StringBuilder
 RenderContext sql(int sql)
          Append some SQL to the context's contained StringBuilder
 RenderContext sql(QueryPart part)
          Recurse rendering
 RenderContext sql(String sql)
          Append some SQL to the context's contained StringBuilder
 
Methods inherited from interface org.jooq.Context
declareFields, declareFields, declareTables, declareTables, nextIndex, peekIndex, subquery, subquery
 
Methods inherited from interface org.jooq.Configuration
getConnection, getData, getData, getDataSource, getDialect, getSchemaMapping, getSettings, setConnection, setData, setDataSource
 

Method Detail

peekAlias

String peekAlias()
Peek the next alias that will be generated by nextAlias()


nextAlias

String nextAlias()
Return a new alias that is unique for the scope of one query. These aliases are sometimes needed when unaliased projections are defined in subqueries, which can lead to syntax errors.


render

String render()
Render the context's underlying SQL statement


render

String render(QueryPart part)
Render a query part in a new context derived from this one. The rendered SQL will not be appended to this context.


keyword

RenderContext keyword(String keyword)
Append a SQL keyword to the context's contained StringBuilder

Use this to have your SQL keyword rendered in RenderKeywordStyle (upper or lower case)


sql

RenderContext sql(String sql)
Append some SQL to the context's contained StringBuilder


sql

RenderContext sql(char sql)
Append some SQL to the context's contained StringBuilder


sql

RenderContext sql(int sql)
Append some SQL to the context's contained StringBuilder


sql

RenderContext sql(QueryPart part)
Recurse rendering


formatNewLine

RenderContext formatNewLine()
Render a new line character (only if Settings.isRenderFormatted() is set to true)


formatSeparator

RenderContext formatSeparator()
Render a new line character (only if Settings.isRenderFormatted() is set to true), or a whitespace separator character otherwise


formatIndentStart

RenderContext formatIndentStart()
Start indenting subsequent SQL by one level (two characters), if Settings.isRenderFormatted() is set to true

This is the same as calling formatIndentStart(int) with a parameter of 2


formatIndentStart

RenderContext formatIndentStart(int indent)
Start indenting subsequent SQL by a number of characters, if Settings.isRenderFormatted() is set to true


formatIndentLockStart

RenderContext formatIndentLockStart()
Start indenting subsequent SQL at the same level as the current line, if Settings.isRenderFormatted() is set to true


formatIndentEnd

RenderContext formatIndentEnd()
Stop indenting subsequent SQL by one level (two characters), if Settings.isRenderFormatted() is set to true

This is the same as calling formatIndentEnd(int) with a parameter of 2


formatIndentEnd

RenderContext formatIndentEnd(int indent)
Stop indenting subsequent SQL by a number of characters, if Settings.isRenderFormatted() is set to true


formatIndentLockEnd

RenderContext formatIndentLockEnd()
Stop indenting subsequent SQL at the same level as the current line, if Settings.isRenderFormatted() is set to true


literal

RenderContext literal(String literal)
Append some (quoted) literal to the context's contained StringBuilder


inline

boolean inline()
Whether bind variables should be inlined, rather than rendered as '?'


inline

RenderContext inline(boolean inline)
Set the new context value for inline()


qualify

boolean qualify()
Whether query parts should render qualified names or not


qualify

RenderContext qualify(boolean qualify)
Sett the new context value for qualify()


namedParams

boolean namedParams()
Whether bind variables should be rendered as named parameters:
  :1, :2, :custom_name

or as JDBC bind variables
  ?


namedParams

RenderContext namedParams(boolean renderNamedParams)
Set the new context value for namedParams()


castMode

RenderContext.CastMode castMode()
The currently applied cast mode for bind values


castMode

RenderContext castMode(RenderContext.CastMode mode)
Set the new cast mode for castMode()


cast

Boolean cast()
Whether casting must be applied. The result follows this logic:
CastMode result
ALWAYS true
NEVER false
SOME true or false depending on the dialect
DEFAULT null


castModeSome

RenderContext castModeSome(SQLDialect... dialects)
Set the new cast mode to RenderContext.CastMode.SOME for a list of dialects



Copyright © 2012. All Rights Reserved.