Methods Summary |
---|
public org.hibernate.type.Type | getExpectedType()
return expectedType;
|
public java.lang.String | getRenderText(org.hibernate.engine.SessionFactoryImplementor sessionFactory)
Type type = expectedType == null ? heuristicType : expectedType;
return resolveToLiteralString( type );
|
private java.lang.String | resolveToLiteralString(org.hibernate.type.Type type)
try {
LiteralType literalType = ( LiteralType ) type;
Dialect dialect = factory.getDialect();
return literalType.objectToSQLString( constantValue, dialect );
}
catch ( Throwable t ) {
throw new QueryException( QueryTranslator.ERROR_CANNOT_FORMAT_LITERAL + constantExpression, t );
}
|
public void | setExpectedType(org.hibernate.type.Type expectedType)
this.expectedType = expectedType;
|
public void | setSessionFactory(org.hibernate.engine.SessionFactoryImplementor factory)
this.factory = factory;
|
public void | setText(java.lang.String s)
// for some reason the antlr.CommonAST initialization routines force
// this method to get called twice. The first time with an empty string
if ( StringHelper.isNotEmpty( s ) ) {
constantExpression = s;
constantValue = ReflectHelper.getConstantValue( s );
heuristicType = TypeFactory.heuristicType( constantValue.getClass().getName() );
super.setText( s );
}
|