org.sql.generation.api.grammar.factories
Interface LiteralFactory


public interface LiteralFactory

A factory to create various literal expressions. This factory is obtainable from SQLVendor.

Author:
Stanislav Muhametsin
See Also:
SQLVendor

Method Summary
 DateTimeLiteral dt(java.sql.Date date)
          Creates a literal, which has some date as content.
 SQLFunctionLiteral func(java.lang.String name, ValueExpression... parameters)
          Creates a literal, which represents a use of SQL function.
 DirectLiteral l(java.lang.String literalContents)
          Creates a literal, which has some textual content.
 NumericLiteral n(java.lang.Number number)
          Creates a literal, which has some number as contents.
 DirectLiteral param()
          Returns literal, representing a parameter (?)
 StringLiteral s(java.lang.String stringContents)
          Creates new string literal, that is, a string to be enclosed in ' -characters.
 

Method Detail

s

StringLiteral s(java.lang.String stringContents)
Creates new string literal, that is, a string to be enclosed in ' -characters.

Parameters:
stringContents - The contents of string literal.
Returns:
The new StringLiteral

param

DirectLiteral param()
Returns literal, representing a parameter (?) in parameterized SQL statement.

Returns:
The expression representing parameter (?) in parameterized SQL statement.

l

DirectLiteral l(java.lang.String literalContents)
Creates a literal, which has some textual content. This content will be used directly when processing SQL statement.

Parameters:
literalContents - The contents to be used.
Returns:
The new DirectLiteral.

dt

DateTimeLiteral dt(java.sql.Date date)
Creates a literal, which has some date as content.

Parameters:
date - The date to use.
Returns:
The new DateTimeLiteral.

n

NumericLiteral n(java.lang.Number number)
Creates a literal, which has some number as contents.

Parameters:
number - The number to use.
Returns:
The new NumericLiteral.

func

SQLFunctionLiteral func(java.lang.String name,
                        ValueExpression... parameters)
Creates a literal, which represents a use of SQL function.

Parameters:
name - The name of function.
parameters - The parameters for function.
Returns:
The new SQLFunctionLiteral.


Copyright © 2010. All Rights Reserved.