( (ParameterNode) versionValueNode ).setHqlParameterSpecification( paramSpec );
parameters.add( 0, paramSpec );
if ( sessionFactoryHelper.getFactory().getDialect().requiresCastingOfParametersInSelectClause() ) {
// we need to wrtap the param in a cast()
MethodNode versionMethodNode = (MethodNode) getASTFactory().create(
HqlSqlTokenTypes.METHOD_CALL,
"("
);
AST methodIdentNode = getASTFactory().create( HqlSqlTokenTypes.IDENT, "cast" );
versionMethodNode.addChild( methodIdentNode );
versionMethodNode.initializeMethodNode( methodIdentNode, true );
AST castExprListNode = getASTFactory().create( HqlSqlTokenTypes.EXPR_LIST, "exprList" );
methodIdentNode.setNextSibling( castExprListNode );
castExprListNode.addChild( versionValueNode );
versionValueNode.setNextSibling(
getASTFactory().create(