public Type getDataType() { return ( (SqlNode) getOperand() ).getDataType(); }
protected Type extractDataType(Node operand) { Type type = null; if ( operand instanceof SqlNode ) { type = ( (SqlNode) operand ).getDataType(); } if ( type == null && operand instanceof ExpectedTypeAwareNode ) { type = ( (ExpectedTypeAwareNode) operand ).getExpectedType(); } return type; }
private static Type extractDataType(Node operand) { if ( operand instanceof SqlNode ) { return ( (SqlNode) operand ).getDataType(); } if ( operand instanceof ExpectedTypeAwareNode ) { return ( (ExpectedTypeAwareNode) operand ).getExpectedType(); } return null; }
public Type getFirstArgumentType() { AST argument = getFirstChild(); while ( argument != null ) { if ( argument instanceof SqlNode ) { final Type type = ( (SqlNode) argument ).getDataType(); if ( type != null ) { return type; } argument = argument.getNextSibling(); } } return null; }
@Override public Type getFirstArgumentType() { AST argument = getFirstChild(); while ( argument != null ) { if ( argument instanceof SqlNode ) { final Type type = ( (SqlNode) argument ).getDataType(); if ( type != null ) { return type; } argument = argument.getNextSibling(); } } return null; }
public Type findFunctionReturnType(String functionName, SQLFunction sqlFunction, AST firstArgument) { // determine the type of the first argument... Type argumentType = null; if ( firstArgument != null ) { if ( "cast".equals( functionName ) ) { argumentType = sfi.getTypeResolver().heuristicType( firstArgument.getNextSibling().getText() ); } else if ( SqlNode.class.isInstance( firstArgument ) ) { argumentType = ( (SqlNode) firstArgument ).getDataType(); } } return sqlFunction.getReturnType( argumentType, sfi ); }
private void collectionProperty(AST path, AST name) throws SemanticException { if ( path == null ) { throw new SemanticException( "Collection function " + name.getText() + " has no path!" ); } SqlNode expr = (SqlNode) path; Type type = expr.getDataType(); LOG.debugf( "collectionProperty() : name=%s type=%s", name, type ); resolveCollectionProperty( expr ); }
final Node rhs = getRightHandOperand(); final Type lhType = ( lhs instanceof SqlNode ) ? ( (SqlNode) lhs ).getDataType() : null; final Type rhType = ( rhs instanceof SqlNode ) ? ( (SqlNode) rhs ).getDataType() : null;
expectedType = ( (SqlNode) fixture ).getDataType(); expectedType = ( (SqlNode) low ).getDataType(); expectedType = ( (SqlNode) high ).getDataType();
final Type lhType = ( lhs instanceof SqlNode ) ? ( (SqlNode) lhs ).getDataType() : null; final Type rhType = ( rhs instanceof SqlNode ) ? ( (SqlNode) rhs ).getDataType() : null;
public Type getDataType() { final AST expression = getFirstChild(); // option is used to hold each WHEN/ELSE in turn AST option = expression.getNextSibling(); while ( option != null ) { final AST result; if ( option.getType() == HqlSqlTokenTypes.WHEN ) { result = option.getFirstChild().getNextSibling(); } else if ( option.getType() == HqlSqlTokenTypes.ELSE ) { result = option.getFirstChild(); } else { throw new QueryException( "Unexpected node type :" + ASTUtil.getTokenTypeName( HqlSqlTokenTypes.class, option.getType() ) + "; expecting WHEN or ELSE" ); } if ( SqlNode.class.isInstance( result ) ) { final Type nodeDataType = ( (SqlNode) result ).getDataType(); if ( nodeDataType != null ) { return nodeDataType; } } option = option.getNextSibling(); } return null; }
@Override public Type getDataType() { // option is used to hold each WHEN/ELSE in turn AST option = getFirstChild(); while ( option != null ) { final AST result; if ( option.getType() == HqlSqlTokenTypes.WHEN ) { result = option.getFirstChild().getNextSibling(); } else if ( option.getType() == HqlSqlTokenTypes.ELSE ) { result = option.getFirstChild(); } else { throw new QueryException( "Unexpected node type :" + ASTUtil.getTokenTypeName( HqlSqlTokenTypes.class, option.getType() ) + "; expecting WHEN or ELSE" ); } if ( SqlNode.class.isInstance( result ) ) { final Type nodeDataType = ( (SqlNode) result ).getDataType(); if ( nodeDataType != null ) { return nodeDataType; } } option = option.getNextSibling(); } return null; }
Type lhsType = ( (SqlNode) lhs ).getDataType(); AST inListChild = inList.getFirstChild(); while ( inListChild != null ) {
final Type expressionType = ( (SqlNode) expressionNode ).getDataType(); if ( expressionType != null ) { if ( expressionType.isEntityType() ) {
protected Type extractDataType(Node operand) { Type type = null; if ( operand instanceof SqlNode ) { type = ( ( SqlNode ) operand ).getDataType(); } if ( type == null && operand instanceof ExpectedTypeAwareNode ) { type = ( ( ExpectedTypeAwareNode ) operand ).getExpectedType(); } return type; }
private static Type extractDataType(Node operand) { Type type = null; if ( operand instanceof SqlNode ) { type = ( ( SqlNode ) operand ).getDataType(); } if ( type == null && operand instanceof ExpectedTypeAwareNode ) { type = ( ( ExpectedTypeAwareNode ) operand ).getExpectedType(); } return type; }
protected Type extractDataType(Node operand) { Type type = null; if ( operand instanceof SqlNode ) { type = ( ( SqlNode ) operand ).getDataType(); } if ( type == null && operand instanceof ExpectedTypeAwareNode ) { type = ( ( ExpectedTypeAwareNode ) operand ).getExpectedType(); } return type; }
private static Type extractDataType(Node operand) { Type type = null; if ( operand instanceof SqlNode ) { type = ( ( SqlNode ) operand ).getDataType(); } if ( type == null && operand instanceof ExpectedTypeAwareNode ) { type = ( ( ExpectedTypeAwareNode ) operand ).getExpectedType(); } return type; }
private void collectionProperty(AST path, AST name) throws SemanticException { if ( path == null ) { throw new SemanticException( "Collection function " + name.getText() + " has no path!" ); } SqlNode expr = ( SqlNode ) path; Type type = expr.getDataType(); LOG.debugf( "collectionProperty() : name=%s type=%s", name, type ); resolveCollectionProperty( expr ); }
private void collectionProperty(AST path, AST name) throws SemanticException { if ( path == null ) { throw new SemanticException( "Collection function " + name.getText() + " has no path!" ); } SqlNode expr = ( SqlNode ) path; Type type = expr.getDataType(); LOG.debugf( "collectionProperty() : name=%s type=%s", name, type ); resolveCollectionProperty( expr ); }