HHH-3510 : HQL SQLFunction replacement not occuring when HQL text has no parenthesis (rollback)

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@15243 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Steve Ebersole 2008-10-01 21:25:02 +00:00
parent d4f929aab3
commit bd3170db4f
1 changed files with 13 additions and 23 deletions

View File

@ -27,7 +27,6 @@ package org.hibernate.hql.ast.tree;
import antlr.SemanticException; import antlr.SemanticException;
import antlr.collections.AST; import antlr.collections.AST;
import org.hibernate.QueryException; import org.hibernate.QueryException;
import org.hibernate.dialect.function.SQLFunction;
import org.hibernate.hql.antlr.SqlTokenTypes; import org.hibernate.hql.antlr.SqlTokenTypes;
import org.hibernate.hql.ast.util.ColumnHelper; import org.hibernate.hql.ast.util.ColumnHelper;
import org.hibernate.persister.collection.QueryableCollection; import org.hibernate.persister.collection.QueryableCollection;
@ -38,7 +37,6 @@ import org.hibernate.type.Type;
import org.hibernate.util.StringHelper; import org.hibernate.util.StringHelper;
import java.util.List; import java.util.List;
import java.util.Collections;
/** /**
* Represents an identifier all by itself, which may be a function name, * Represents an identifier all by itself, which may be a function name,
@ -129,14 +127,6 @@ public class IdentNode extends FromReferenceNode implements SelectExpression {
// resolve this... // resolve this...
return; return;
} }
else if ( result == UNKNOWN ) {
final SQLFunction sqlFunction = getSessionFactoryHelper().findSQLFunction( getText() );
if ( sqlFunction != null ) {
setText( sqlFunction.render( Collections.EMPTY_LIST, getSessionFactoryHelper().getFactory() ) );
setDataType( sqlFunction.getReturnType( null, getSessionFactoryHelper().getFactory() ) );
setResolved();
}
}
} }
// if we are still not resolved, we might represent a constant. // if we are still not resolved, we might represent a constant.
@ -334,7 +324,7 @@ public class IdentNode extends FromReferenceNode implements SelectExpression {
buf.append("}"); buf.append("}");
} }
else { else {
buf.append( "{originalText=" ).append( getOriginalText() ).append( "}" ); buf.append("{originalText=" + getOriginalText()).append("}");
} }
return buf.toString(); return buf.toString();
} }