Package com.akiban.sql.types

Examples of com.akiban.sql.types.TypeId


     */
    public void init(Object arg1) throws StandardException {
        int precision = 0, scal = 0, maxwidth = 0;
        Boolean isNullable;
        boolean valueInP; // value in Predicate-- if TRUE a value was passed in
        TypeId typeId = null;
        int typeid = 0;

        if (arg1 instanceof TypeId) {
            typeId = (TypeId)arg1;
            isNullable = Boolean.TRUE;
View Full Code Here


                       Boolean.TRUE,
                       DataTypeDescriptor.MAXIMUM_WIDTH_UNKNOWN);
        }
        else {
            Integer maxWidth = null;
            TypeId typeId = null;

            if (arg1 instanceof Date) {
                maxWidth = TypeId.DATE_MAXWIDTH;
                typeId = TypeId.getBuiltInTypeId(Types.DATE);
            }
View Full Code Here

        {if (true) return typeDescriptor;}
    throw new Error("Missing return statement in function");
  }

  final public DataTypeDescriptor intervalQualifier() throws ParseException, StandardException {
    TypeId typeId, otherId = null;
    int[] precAndScale = new int[2];
    if ((getToken(2).kind == TO) ||
                           ((getToken(2).kind == LEFT_PAREN) &&
                            (getToken(5).kind == TO))) {
      typeId = intervalStartField(precAndScale);
View Full Code Here

                                      true, DataTypeDescriptor.intervalMaxWidth(typeId, precAndScale[0], precAndScale[1]));}
    throw new Error("Missing return statement in function");
  }

  final public TypeId intervalStartField(int[] precAndScale) throws ParseException, StandardException {
    TypeId typeId;
    Token prec;
    typeId = intervalNonSecond();
    switch (jj_nt.kind) {
    case LEFT_PAREN:
      jj_consume_token(LEFT_PAREN);
View Full Code Here

        {if (true) return typeId;}
    throw new Error("Missing return statement in function");
  }

  final public TypeId intervalEndField(int[] precAndScale) throws ParseException, StandardException {
    TypeId typeId;
    Token scale;
    switch (jj_nt.kind) {
    case HOUR:
    case MINUTE:
    case YEAR:
View Full Code Here

    }
    throw new Error("Missing return statement in function");
  }

  final public TypeId intervalSingleField(int[] precAndScale) throws ParseException, StandardException {
    TypeId typeId;
    Token prec = null, scale = null;
    switch (jj_nt.kind) {
    case HOUR:
    case MINUTE:
    case YEAR:
View Full Code Here

    }
    throw new Error("Missing return statement in function");
  }

  final public DataTypeDescriptor jdbcIntervalTypeDescriptor(int[] factors) throws ParseException, StandardException {
    TypeId typeId;
    int prec = 0, scale = 0;
    switch (jj_nt.kind) {
    case SQL_TSI_FRAC_SECOND:
    case MICROSECOND:
      switch (jj_nt.kind) {
View Full Code Here

        {if (true) return value;}
    throw new Error("Missing return statement in function");
  }

  final public DataTypeDescriptor mysqlIntervalQualifier(int[] factors) throws ParseException, StandardException {
    TypeId typeId;
    int prec = 0, scale = 0;
    switch (jj_nt.kind) {
    case MICROSECOND:
      jj_consume_token(MICROSECOND);
        typeId = TypeId.INTERVAL_SECOND_ID;
View Full Code Here

    public DataTypeDescriptor resolveArithmeticOperation(DataTypeDescriptor leftType,
                                                         DataTypeDescriptor rightType,
                                                         String operator)
            throws StandardException {
        TypeId leftTypeId = leftType.getTypeId();
        TypeId rightTypeId = rightType.getTypeId();
        if (leftTypeId.equals(rightTypeId))
            return leftType;

        throw new StandardException("Types not compatible for " + operator +
                                    ": " + leftTypeId.getSQLTypeName() +
                                    " and " + rightTypeId.getSQLTypeName());
    }
View Full Code Here

     */
    public DataTypeDescriptor resolveArithmeticOperation(DataTypeDescriptor leftType,
                                                         DataTypeDescriptor rightType,
                                                         String operator)
            throws StandardException {
        TypeId rightTypeId = rightType.getTypeId();
        boolean nullable = leftType.isNullable() || rightType.isNullable();
        if (rightTypeId.isDateTimeTimeStampTypeId()) {
            if (operator.equals(TypeCompiler.MINUS_OP)) {
                switch (rightTypeId.getTypeFormatId()) {
                case TypeId.FormatIds.DATE_TYPE_ID:
                    // DATE - DATE is INTERVAL DAY
                    return new DataTypeDescriptor(TypeId.INTERVAL_DAY_ID, nullable);
                default:
                    // DATE - other datetime is INTERVAL DAY TO SECOND
                    return new DataTypeDescriptor(TypeId.INTERVAL_DAY_SECOND_ID, nullable);
                }
            }
        }
        else if (rightTypeId.isIntervalTypeId()) {
            if (operator.equals(TypeCompiler.PLUS_OP) ||
                operator.equals(TypeCompiler.MINUS_OP)) {
                switch (rightTypeId.getTypeFormatId()) {
                case TypeId.FormatIds.INTERVAL_YEAR_MONTH_ID:
                    // DATE +/- month year interval is DATE
                    return leftType.getNullabilityType(nullable);
                case TypeId.FormatIds.INTERVAL_DAY_SECOND_ID:
                    if (rightTypeId == TypeId.INTERVAL_DAY_ID)
View Full Code Here

TOP

Related Classes of com.akiban.sql.types.TypeId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.