Top Description Inners Fields Constructors Methods
org.hibernate.hql.ast.util

public Class LiteralProcessor

extends Object
implements HqlSqlTokenTypes
Class Inheritance
All Implemented Interfaces
org.hibernate.hql.antlr.HqlSqlTokenTypes
Imports
org.hibernate.MappingException, .QueryException, .HibernateException, org.hibernate.dialect.Dialect, org.hibernate.hql.QueryTranslator, org.hibernate.hql.antlr.HqlSqlTokenTypes, .SqlTokenTypes, org.hibernate.hql.ast.HqlSqlWalker, .InvalidPathException, org.hibernate.hql.ast.tree.DotNode, .FromClause, .IdentNode, org.hibernate.persister.entity.Queryable, org.hibernate.sql.InFragment, org.hibernate.type.LiteralType, .Type, .TypeFactory, org.hibernate.util.ReflectHelper, antlr.SemanticException, antlr.collections.AST, org.slf4j.Logger, .LoggerFactory, java.math.BigDecimal, .BigInteger, java.text.DecimalFormat

A delegate that handles literals and constants for HqlSqlWalker, performing the token replacement functions and classifying literals.
Author
josh

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static interface
private static class

Field Summary

Modifier and TypeField and Description
public static final int
APPROXIMATE

Indicates that Float and Double literal values should be treated using the SQL "approximate" format (i.e., '1E-3')

public static int
DECIMAL_LITERAL_FORMAT

In what format should Float and Double literal values be sent to the database?

public static final int
EXACT

Indicates that Float and Double literal values should be treated using the SQL "exact" format (i.e., '.001')

private static final LiteralProcessor.DecimalFormatter[]
private static final Logger
private HqlSqlWalker

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
private String
public boolean
isAlias(String alias)

public void
public void
processBoolean(AST constant)

public void
processConstant(AST constant, boolean resolveIdent)

private void
processLiteral(AST constant)

public void
private void
private void
setSQLValue(DotNode node, String text, String value)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

APPROXIMATEback to summary
public static final int APPROXIMATE

Indicates that Float and Double literal values should be treated using the SQL "approximate" format (i.e., '1E-3')

DECIMAL_LITERAL_FORMATback to summary
public static int DECIMAL_LITERAL_FORMAT

In what format should Float and Double literal values be sent to the database?

See Also
APPROXIMATE
EXACTback to summary
public static final int EXACT

Indicates that Float and Double literal values should be treated using the SQL "exact" format (i.e., '.001')

formattersback to summary
private static final LiteralProcessor.DecimalFormatter[] formatters
logback to summary
private static final Logger log
walkerback to summary
private HqlSqlWalker walker

Constructor Detail

LiteralProcessorback to summary
public LiteralProcessor(HqlSqlWalker hqlSqlWalker)

Method Detail

determineDecimalRepresentationback to summary
public String determineDecimalRepresentation(String text, int type)
determineIntegerRepresentationback to summary
private String determineIntegerRepresentation(String text, int type)
isAliasback to summary
public boolean isAlias(String alias)
lookupConstantback to summary
public void lookupConstant(DotNode node) throws SemanticException
processBooleanback to summary
public void processBoolean(AST constant)
processConstantback to summary
public void processConstant(AST constant, boolean resolveIdent) throws SemanticException
processLiteralback to summary
private void processLiteral(AST constant)
processNumericback to summary
public void processNumeric(AST literal)
setConstantValueback to summary
private void setConstantValue(DotNode node, String text, Object value)
setSQLValueback to summary
private void setSQLValue(DotNode node, String text, String value)
org.hibernate.hql.ast.util back to summary

private Class LiteralProcessor.ApproximateDecimalFormatter

extends Object
implements DecimalFormatter
Class Inheritance
  • java.lang.Object
  • org.hibernate.hql.ast.util.LiteralProcessor.ApproximateDecimalFormatter
All Implemented Interfaces
org.hibernate.hql.ast.util.LiteralProcessor.DecimalFormatter

Field Summary

Modifier and TypeField and Description
private static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FORMAT_STRINGback to summary
private static final String FORMAT_STRING

Constructor Detail

ApproximateDecimalFormatterback to summary
private ApproximateDecimalFormatter()

Method Detail

formatback to summary
public String format(BigDecimal number)

Implements org.hibernate.hql.ast.util.LiteralProcessor.DecimalFormatter.format.

org.hibernate.hql.ast.util back to summary

private Interface LiteralProcessor.DecimalFormatter

Known Direct Implementers
org.hibernate.hql.ast.util.LiteralProcessor.ExactDecimalFormatter, org.hibernate.hql.ast.util.LiteralProcessor.ApproximateDecimalFormatter

Method Summary

Modifier and TypeMethod and Description
public String

Method Detail

formatback to summary
public String format(BigDecimal number)
org.hibernate.hql.ast.util back to summary

private Class LiteralProcessor.ExactDecimalFormatter

extends Object
implements DecimalFormatter
Class Inheritance
  • java.lang.Object
  • org.hibernate.hql.ast.util.LiteralProcessor.ExactDecimalFormatter
All Implemented Interfaces
org.hibernate.hql.ast.util.LiteralProcessor.DecimalFormatter

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ExactDecimalFormatterback to summary
private ExactDecimalFormatter()

Method Detail

formatback to summary
public String format(BigDecimal number)

Implements org.hibernate.hql.ast.util.LiteralProcessor.DecimalFormatter.format.