@Override public String getDisplayText() { return "{dataType=" + getDataType() + "}"; } }
/** * Retrieves the left-hand operand of the operator. * * @return The left-hand operand */ @Override public Node getLeftHandOperand() { return (Node) getFirstChild(); }
@Override public void initialize() throws SemanticException { final Node lhs = getLeftHandOperand(); if ( lhs == null ) { throw new SemanticException( "left-hand operand of a binary operator was null" ); final Node rhs = getRightHandOperand(); if ( rhs == null ) { throw new SemanticException( "right-hand operand of a binary operator was null" ); Type expectedType = null; if ( isDateTimeType( rhType ) ) { expectedType = getType() == HqlSqlTokenTypes.PLUS ? StandardBasicTypes.DOUBLE : rhType; Type expectedType = null; if ( isDateTimeType( lhType ) ) { if ( getType() == HqlSqlTokenTypes.PLUS ) { expectedType = StandardBasicTypes.DOUBLE;
boolean lhsIsDateTime = isDateTimeType( lhType ); boolean rhsIsDateTime = isDateTimeType( rhType ); if ( getType() == HqlSqlTokenTypes.PLUS ) { else if ( getType() == HqlSqlTokenTypes.MINUS ) {
final Node lhs = getLeftHandOperand(); final Node rhs = getRightHandOperand(); if ( isDateTimeType( lhType ) || isDateTimeType( rhType ) ) { return resolveDateTimeArithmeticResultType( lhType, rhType );
/** * Figure out the type of the binary expression by looking at * the types of the operands. Sometimes we don't know both types, * if, for example, one is a parameter. */ @Override public Type getDataType() { if ( super.getDataType() == null ) { super.setDataType( resolveDataType() ); } return super.getDataType(); }
Node lhs = getLeftHandOperand(); Node rhs = getRightHandOperand(); Type lhType = ( lhs instanceof SqlNode ) ? ( ( SqlNode ) lhs ).getDataType() : null; Type rhType = ( rhs instanceof SqlNode ) ? ( ( SqlNode ) rhs ).getDataType() : null; if ( isDateTimeType( lhType ) || isDateTimeType( rhType ) ) { return resolveDateTimeArithmeticResultType( lhType, rhType );
boolean lhsIsDateTime = isDateTimeType( lhType ); boolean rhsIsDateTime = isDateTimeType( rhType ); if ( getType() == HqlSqlTokenTypes.PLUS ) { else if ( getType() == HqlSqlTokenTypes.MINUS ) {
/** * Figure out the type of the binary expression by looking at * the types of the operands. Sometimes we don't know both types, * if, for example, one is a parameter. */ public Type getDataType() { if ( super.getDataType() == null ) { super.setDataType( resolveDataType() ); } return super.getDataType(); }
public void initialize() throws SemanticException { Node lhs = getLeftHandOperand(); Node rhs = getRightHandOperand(); if ( lhs == null ) { throw new SemanticException( "left-hand operand of a binary operator was null" ); Type expectedType = null; if ( isDateTimeType( rhType ) ) { expectedType = getType() == HqlSqlTokenTypes.PLUS ? StandardBasicTypes.DOUBLE : rhType; Type expectedType = null; if ( isDateTimeType( lhType ) ) { if ( getType() == HqlSqlTokenTypes.PLUS ) { expectedType = StandardBasicTypes.DOUBLE;
Node lhs = getLeftHandOperand(); Node rhs = getRightHandOperand(); Type lhType = ( lhs instanceof SqlNode ) ? ( ( SqlNode ) lhs ).getDataType() : null; Type rhType = ( rhs instanceof SqlNode ) ? ( ( SqlNode ) rhs ).getDataType() : null; if ( isDateTimeType( lhType ) || isDateTimeType( rhType ) ) { return resolveDateTimeArithmeticResultType( lhType, rhType );
boolean lhsIsDateTime = isDateTimeType( lhType ); boolean rhsIsDateTime = isDateTimeType( rhType ); if ( getType() == HqlSqlTokenTypes.PLUS ) { else if ( getType() == HqlSqlTokenTypes.MINUS ) {
/** * Retrieves the right-hand operand of the operator. * * @return The right-hand operand */ @Override public Node getRightHandOperand() { return (Node) getFirstChild().getNextSibling(); }
public String getDisplayText() { return "{dataType=" + getDataType() + "}"; } }
/** * Figure out the type of the binary expression by looking at * the types of the operands. Sometimes we don't know both types, * if, for example, one is a parameter. */ public Type getDataType() { if ( super.getDataType() == null ) { super.setDataType( resolveDataType() ); } return super.getDataType(); }
public void initialize() throws SemanticException { Node lhs = getLeftHandOperand(); Node rhs = getRightHandOperand(); if ( lhs == null ) { throw new SemanticException( "left-hand operand of a binary operator was null" ); Type expectedType = null; if ( isDateTimeType( rhType ) ) { expectedType = getType() == HqlSqlTokenTypes.PLUS ? StandardBasicTypes.DOUBLE : rhType; Type expectedType = null; if ( isDateTimeType( lhType ) ) { if ( getType() == HqlSqlTokenTypes.PLUS ) { expectedType = StandardBasicTypes.DOUBLE;
/** * Retrieves the left-hand operand of the operator. * * @return The left-hand operand */ public Node getLeftHandOperand() { return ( Node ) getFirstChild(); }
public String getDisplayText() { return "{dataType=" + getDataType() + "}"; } }
/** * Retrieves the left-hand operand of the operator. * * @return The left-hand operand */ public Node getLeftHandOperand() { return ( Node ) getFirstChild(); }
/** * Retrieves the right-hand operand of the operator. * * @return The right-hand operand */ public Node getRightHandOperand() { return ( Node ) getFirstChild().getNextSibling(); }