Package org.apache.derby.catalog.types

Examples of org.apache.derby.catalog.types.BaseTypeIdImpl


                {
                  case Types.TINYINT:
                          ret = TINYINT_ID;
                          if (ret == null)
                                  ret = TINYINT_ID = new TypeId(StoredFormatIds.TINYINT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.TINYINT_TYPE_ID_IMPL));
                          break;

                  case Types.SMALLINT:
                          ret = SMALLINT_ID;
                          if (ret == null)
                                  ret = SMALLINT_ID = new TypeId(StoredFormatIds.SMALLINT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.SMALLINT_TYPE_ID_IMPL));
                          break;

                  case Types.INTEGER:
                          return INTEGER_ID;

                  case Types.BIGINT:
                          ret = LONGINT_ID;
                          if (ret == null)
                                  ret = LONGINT_ID = new TypeId(StoredFormatIds.LONGINT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.LONGINT_TYPE_ID_IMPL));
                          break;

                  case Types.REAL:
                          ret = REAL_ID;
                          if (ret == null)
                                  ret = REAL_ID = new TypeId(StoredFormatIds.REAL_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.REAL_TYPE_ID_IMPL));
                          break;

                  case Types.FLOAT:
                  case Types.DOUBLE:
                          ret = DOUBLE_ID;
                          if (ret == null)
                                  ret = DOUBLE_ID = new TypeId(StoredFormatIds.DOUBLE_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.DOUBLE_TYPE_ID_IMPL));
                          break;

                  case Types.DECIMAL:
                          ret = DECIMAL_ID;
                          if (ret == null)
                                  ret = DECIMAL_ID = new TypeId(StoredFormatIds.DECIMAL_TYPE_ID,
                                                                        new DecimalTypeIdImpl());
                          break;

                  case Types.NUMERIC:
                          ret = NUMERIC_ID;
                          if (ret == null) {
                                  DecimalTypeIdImpl numericTypeIdImpl = new DecimalTypeIdImpl();
                                  numericTypeIdImpl.setNumericType();
                                  ret = NUMERIC_ID = new TypeId(StoredFormatIds.DECIMAL_TYPE_ID, numericTypeIdImpl);
                          }
                          break;

                  case Types.CHAR:
                          return CHAR_ID;

                  case Types.VARCHAR:
                          ret = VARCHAR_ID;
                          if (ret == null)
                                  ret = VARCHAR_ID = new TypeId(StoredFormatIds.VARCHAR_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.VARCHAR_TYPE_ID_IMPL));
                          break;

                  case Types.DATE:
                          ret = DATE_ID;
                          if (ret == null)
                                  ret = DATE_ID = new TypeId(StoredFormatIds.DATE_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.DATE_TYPE_ID_IMPL));
                          break;

                  case Types.TIME:
                          ret = TIME_ID;
                          if (ret == null)
                                  ret = TIME_ID = new TypeId(StoredFormatIds.TIME_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.TIME_TYPE_ID_IMPL));
                          break;

                  case Types.TIMESTAMP:
                          ret = TIMESTAMP_ID;
                          if (ret == null)
                                  ret = TIMESTAMP_ID = new TypeId(StoredFormatIds.TIMESTAMP_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.TIMESTAMP_TYPE_ID_IMPL));
                          break;
                  case Types.BIT:
                  case JDBC30Translation.SQL_TYPES_BOOLEAN:
                          return BOOLEAN_ID;

                  case Types.BINARY:
                          ret = BIT_ID;
                          if (ret == null)
                                  ret = BIT_ID = new TypeId(StoredFormatIds.BIT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.BIT_TYPE_ID_IMPL));
                          break;

                  case Types.VARBINARY:
                          ret = VARBIT_ID;
                          if (ret == null)
                                  ret = VARBIT_ID = new TypeId(StoredFormatIds.VARBIT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.VARBIT_TYPE_ID_IMPL));
                          break;

                  case Types.LONGVARBINARY:
                          ret = LONGVARBIT_ID;
                          if (ret == null)
                                  ret = LONGVARBIT_ID = new TypeId(StoredFormatIds.LONGVARBIT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.LONGVARBIT_TYPE_ID_IMPL));
                          break;

                  case Types.LONGVARCHAR:
                      ret = LONGVARCHAR_ID;
                      if (ret == null)
                          ret = LONGVARCHAR_ID = new TypeId(StoredFormatIds.LONGVARCHAR_TYPE_ID,
                                                            new BaseTypeIdImpl(StoredFormatIds.LONGVARCHAR_TYPE_ID_IMPL));
                      break;

                  case JDBC20Translation.SQL_TYPES_BLOB:
                      ret = BLOB_ID;
                      if (ret == null)
                          ret = BLOB_ID = new TypeId(StoredFormatIds.BLOB_TYPE_ID,
                                                     new BaseTypeIdImpl(StoredFormatIds.BLOB_TYPE_ID_IMPL));
                      break;
                                               
                  case JDBC20Translation.SQL_TYPES_CLOB:
                      ret = CLOB_ID;
                      if (ret == null)
                          ret = CLOB_ID = new TypeId(StoredFormatIds.CLOB_TYPE_ID,
                                                     new BaseTypeIdImpl(StoredFormatIds.CLOB_TYPE_ID_IMPL));
                      break;

                  // XML is not a JDBC type, so we have to check for our
                  // internal XML type.
                  case StoredFormatIds.XML_TYPE_ID:
                      ret = XML_ID;
                      if (ret == null)
                          ret = XML_ID = new TypeId(StoredFormatIds.XML_TYPE_ID,
                                                     new BaseTypeIdImpl(StoredFormatIds.XML_TYPE_ID_IMPL));
                      break;
                }
                return ret;
        }
View Full Code Here


                // Types defined below here are SQL types and non-JDBC types that are supported by Derby
                if (SQLTypeName.equals(TypeId.REF_NAME)) {
                        ret = REF_ID;
                        if (ret == null)
                                ret = REF_ID = new TypeId(StoredFormatIds.REF_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.REF_TYPE_ID_IMPL));
                }
                return ret;
        }
View Full Code Here

         * a BaseTypeIdImpl. Used to create the static final variables
         * of this class.
         */
        private static TypeId create(int typeFormatId, int implTypeFormatId)
        {
            return new TypeId(typeFormatId, new BaseTypeIdImpl(implTypeFormatId));
        }
View Full Code Here

                {
                  case Types.TINYINT:
                          ret = TINYINT_ID;
                          if (ret == null)
                                  ret = TINYINT_ID = new TypeId(StoredFormatIds.TINYINT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.TINYINT_TYPE_ID_IMPL));
                          break;

                  case Types.SMALLINT:
                          ret = SMALLINT_ID;
                          if (ret == null)
                                  ret = SMALLINT_ID = new TypeId(StoredFormatIds.SMALLINT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.SMALLINT_TYPE_ID_IMPL));
                          break;

                  case Types.INTEGER:
                          return INTEGER_ID;

                  case Types.BIGINT:
                          ret = LONGINT_ID;
                          if (ret == null)
                                  ret = LONGINT_ID = new TypeId(StoredFormatIds.LONGINT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.LONGINT_TYPE_ID_IMPL));
                          break;

                  case Types.REAL:
                          ret = REAL_ID;
                          if (ret == null)
                                  ret = REAL_ID = new TypeId(StoredFormatIds.REAL_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.REAL_TYPE_ID_IMPL));
                          break;

                  case Types.FLOAT:
                  case Types.DOUBLE:
                          ret = DOUBLE_ID;
                          if (ret == null)
                                  ret = DOUBLE_ID = new TypeId(StoredFormatIds.DOUBLE_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.DOUBLE_TYPE_ID_IMPL));
                          break;

                  case Types.DECIMAL:
                          ret = DECIMAL_ID;
                          if (ret == null)
                                  ret = DECIMAL_ID = new TypeId(StoredFormatIds.DECIMAL_TYPE_ID,
                                                                        new DecimalTypeIdImpl());
                          break;

                  case Types.NUMERIC:
                          ret = NUMERIC_ID;
                          if (ret == null) {
                                  DecimalTypeIdImpl numericTypeIdImpl = new DecimalTypeIdImpl();
                                  numericTypeIdImpl.setNumericType();
                                  ret = NUMERIC_ID = new TypeId(StoredFormatIds.DECIMAL_TYPE_ID, numericTypeIdImpl);
                          }
                          break;

                  case Types.CHAR:
                          return CHAR_ID;

                  case Types.VARCHAR:
                          ret = VARCHAR_ID;
                          if (ret == null)
                                  ret = VARCHAR_ID = new TypeId(StoredFormatIds.VARCHAR_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.VARCHAR_TYPE_ID_IMPL));
                          break;

                  case Types.DATE:
                          ret = DATE_ID;
                          if (ret == null)
                                  ret = DATE_ID = new TypeId(StoredFormatIds.DATE_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.DATE_TYPE_ID_IMPL));
                          break;

                  case Types.TIME:
                          ret = TIME_ID;
                          if (ret == null)
                                  ret = TIME_ID = new TypeId(StoredFormatIds.TIME_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.TIME_TYPE_ID_IMPL));
                          break;

                  case Types.TIMESTAMP:
                          ret = TIMESTAMP_ID;
                          if (ret == null)
                                  ret = TIMESTAMP_ID = new TypeId(StoredFormatIds.TIMESTAMP_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.TIMESTAMP_TYPE_ID_IMPL));
                          break;
                  case Types.BIT:
                  case JDBC30Translation.SQL_TYPES_BOOLEAN:
                          return BOOLEAN_ID;

                  case Types.BINARY:
                          ret = BIT_ID;
                          if (ret == null)
                                  ret = BIT_ID = new TypeId(StoredFormatIds.BIT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.BIT_TYPE_ID_IMPL));
                          break;

                  case Types.VARBINARY:
                          ret = VARBIT_ID;
                          if (ret == null)
                                  ret = VARBIT_ID = new TypeId(StoredFormatIds.VARBIT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.VARBIT_TYPE_ID_IMPL));
                          break;

                  case Types.LONGVARBINARY:
                          ret = LONGVARBIT_ID;
                          if (ret == null)
                                  ret = LONGVARBIT_ID = new TypeId(StoredFormatIds.LONGVARBIT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.LONGVARBIT_TYPE_ID_IMPL));
                          break;

                  case Types.LONGVARCHAR:
                      ret = LONGVARCHAR_ID;
                      if (ret == null)
                          ret = LONGVARCHAR_ID = new TypeId(StoredFormatIds.LONGVARCHAR_TYPE_ID,
                                                            new BaseTypeIdImpl(StoredFormatIds.LONGVARCHAR_TYPE_ID_IMPL));
                      break;

                  case JDBC20Translation.SQL_TYPES_BLOB:
                      ret = BLOB_ID;
                      if (ret == null)
                          ret = BLOB_ID = new TypeId(StoredFormatIds.BLOB_TYPE_ID,
                                                     new BaseTypeIdImpl(StoredFormatIds.BLOB_TYPE_ID_IMPL));
                      break;
                                               
                  case JDBC20Translation.SQL_TYPES_CLOB:
                      ret = CLOB_ID;
                      if (ret == null)
                          ret = CLOB_ID = new TypeId(StoredFormatIds.CLOB_TYPE_ID,
                                                     new BaseTypeIdImpl(StoredFormatIds.CLOB_TYPE_ID_IMPL));
                      break;

                  // XML is not a JDBC type, so we have to check for our
                  // internal XML type.
                  case StoredFormatIds.XML_TYPE_ID:
                      ret = XML_ID;
                      if (ret == null)
                          ret = XML_ID = new TypeId(StoredFormatIds.XML_TYPE_ID,
                                                     new BaseTypeIdImpl(StoredFormatIds.XML_TYPE_ID_IMPL));
                      break;
                }
                return ret;
        }
View Full Code Here

                // Types defined below here are SQL types and non-JDBC types that are supported by Cloudscape
                if (SQLTypeName.equals(TypeId.NCLOB_NAME)) {
                        ret = NCLOB_ID;
                        if (ret == null)
                                ret = NCLOB_ID = new TypeId(StoredFormatIds.NCLOB_TYPE_ID,
                                                            new BaseTypeIdImpl(StoredFormatIds.NCLOB_TYPE_ID_IMPL));
                } else if (SQLTypeName.equals(TypeId.NATIONAL_CHAR_NAME)) {
                        ret = NATIONAL_CHAR_ID;
                        if (ret == null)
                                ret = NATIONAL_CHAR_ID = new TypeId(StoredFormatIds.NATIONAL_CHAR_TYPE_ID,
                                                                    new BaseTypeIdImpl(StoredFormatIds.NATIONAL_CHAR_TYPE_ID_IMPL));

                } else if (SQLTypeName.equals(TypeId.NATIONAL_LONGVARCHAR_NAME)) {
                        ret = NATIONAL_LONGVARCHAR_ID;
                        if (ret == null)
                                ret = NATIONAL_LONGVARCHAR_ID = new TypeId(StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.NATIONAL_LONGVARCHAR_TYPE_ID_IMPL));

                } else if (SQLTypeName.equals(TypeId.NATIONAL_VARCHAR_NAME)) {
                        ret = NATIONAL_VARCHAR_ID;
                        if (ret == null)
                                ret = NATIONAL_VARCHAR_ID = new TypeId(StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.NATIONAL_VARCHAR_TYPE_ID_IMPL));

                } else if (SQLTypeName.equals(TypeId.REF_NAME)) {
                        ret = REF_ID;
                        if (ret == null)
                                ret = REF_ID = new TypeId(StoredFormatIds.REF_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.REF_TYPE_ID_IMPL));
                }
                return ret;
        }
View Full Code Here

    int columnNumber;
    String columnName;
    String defaultID;
    DefaultInfoImpl    defaultInfo = null;
    ColumnDescriptor colDesc;
    BaseTypeIdImpl    typeId;
    TypeId  wrapperTypeId;
    DataValueDescriptor  defaultValue = null;
    UUID        defaultUUID = null;
    UUID        uuid = null;
    UUIDFactory      uuidFactory = getUUIDFactory();
    long autoincStart, autoincInc;

    DataDescriptorGenerator  ddg = dd.getDataDescriptorGenerator();


    /*
    ** We're going to be getting the UUID for this sucka
    ** so make sure it is a UniqueTupleDescriptor.
    */
    if (parentTupleDescriptor != null)
    {
      if (SanityManager.DEBUG)
      {
        if (!(parentTupleDescriptor instanceof UniqueTupleDescriptor))
        {
          SanityManager.THROWASSERT(parentTupleDescriptor.getClass().getName()
              + " not instanceof UniqueTupleDescriptor")
        }
      }
      uuid = ((UniqueTupleDescriptor)parentTupleDescriptor).getUUID();
    }
    else
    {
      /* 1st column is REFERENCEID (char(36)) */
      uuid = uuidFactory.recreateUUID(row.getColumn(SYSCOLUMNS_REFERENCEID).
                          getString());
    }

    /* NOTE: We get columns 5 and 6 next in order to work around
     * a 1.3.0 HotSpot bug.  (#4361550)
     */

    // 5th column is COLUMNDEFAULT (serialiazable)
    Object object = row.getColumn(SYSCOLUMNS_COLUMNDEFAULT).getObject();
    if (object instanceof DataValueDescriptor)
    {
      defaultValue = (DataValueDescriptor) object;
    }
    else if (object instanceof DefaultInfoImpl)
    {
      defaultInfo = (DefaultInfoImpl) object;
      defaultValue = defaultInfo.getDefaultValue();
    }

    /* 6th column is DEFAULTID (char(36)) */
    defaultID = row.getColumn(SYSCOLUMNS_COLUMNDEFAULTID).getString();

    if (defaultID != null)
    {
      defaultUUID = uuidFactory.recreateUUID(defaultID);
    }

    /* 2nd column is COLUMNNAME (varchar(128)) */
    columnName = row.getColumn(SYSCOLUMNS_COLUMNNAME).getString();

    /* 3rd column is COLUMNNUMBER (int) */
    columnNumber = row.getColumn(SYSCOLUMNS_COLUMNNUMBER).getInt();

    /* 4th column is COLUMNDATATYPE */

    /*
    ** What is stored in the column is a TypeDescriptorImpl, which
    ** points to a BaseTypeIdImpl.  These are simple types that are
    ** intended to be movable to the client, so they don't have
    ** the entire implementation.  We need to wrap them in DataTypeServices
    ** and TypeId objects that contain the full implementations for
    ** language processing.
    */
    TypeDescriptorImpl typeDescriptor = (TypeDescriptorImpl) row.getColumn(SYSCOLUMNS_COLUMNDATATYPE).
                          getObject();
    typeId = typeDescriptor.getTypeId();

    /*
    ** The BaseTypeIdImpl tells what type of TypeId it is supposed to
    ** be wrapped in.
    */
    wrapperTypeId =
      (TypeId) Monitor.newInstanceFromIdentifier(typeId.wrapperTypeFormatId());
    /* Wrap the BaseTypeIdImpl in a full type id */
    wrapperTypeId.setNestedTypeId(typeId);

    /* Wrap the TypeDescriptorImpl in a full DataTypeDescriptor */
    DataTypeDescriptor dataTypeServices = new DataTypeDescriptor(typeDescriptor,
View Full Code Here

    int columnNumber;
    String columnName;
    String defaultID;
    DefaultInfoImpl    defaultInfo = null;
    ColumnDescriptor colDesc;
    BaseTypeIdImpl    typeId;
    TypeId  wrapperTypeId;
    DataValueDescriptor  defaultValue = null;
    UUID        defaultUUID = null;
    UUID        uuid = null;
    UUIDFactory      uuidFactory = getUUIDFactory();
    long autoincStart, autoincInc;

    DataDescriptorGenerator  ddg = dd.getDataDescriptorGenerator();


    /*
    ** We're going to be getting the UUID for this sucka
    ** so make sure it is a UniqueTupleDescriptor.
    */
    if (parentTupleDescriptor != null)
    {
      if (SanityManager.DEBUG)
      {
        if (!(parentTupleDescriptor instanceof UniqueTupleDescriptor))
        {
          SanityManager.THROWASSERT(parentTupleDescriptor.getClass().getName()
              + " not instanceof UniqueTupleDescriptor")
        }
      }
      uuid = ((UniqueTupleDescriptor)parentTupleDescriptor).getUUID();
    }
    else
    {
      /* 1st column is REFERENCEID (char(36)) */
      uuid = uuidFactory.recreateUUID(row.getColumn(SYSCOLUMNS_REFERENCEID).
                          getString());
    }

    /* NOTE: We get columns 5 and 6 next in order to work around
     * a 1.3.0 HotSpot bug.  (#4361550)
     */

    // 5th column is COLUMNDEFAULT (serialiazable)
    Object object = row.getColumn(SYSCOLUMNS_COLUMNDEFAULT).getObject();
    if (object instanceof DataValueDescriptor)
    {
      defaultValue = (DataValueDescriptor) object;
    }
    else if (object instanceof DefaultInfoImpl)
    {
      defaultInfo = (DefaultInfoImpl) object;
      defaultValue = defaultInfo.getDefaultValue();
    }

    /* 6th column is DEFAULTID (char(36)) */
    defaultID = row.getColumn(SYSCOLUMNS_COLUMNDEFAULTID).getString();

    if (defaultID != null)
    {
      defaultUUID = uuidFactory.recreateUUID(defaultID);
    }

    /* 2nd column is COLUMNNAME (varchar(128)) */
    columnName = row.getColumn(SYSCOLUMNS_COLUMNNAME).getString();

    /* 3rd column is COLUMNNUMBER (int) */
    columnNumber = row.getColumn(SYSCOLUMNS_COLUMNNUMBER).getInt();

    /* 4th column is COLUMNDATATYPE */

    /*
    ** What is stored in the column is a TypeDescriptorImpl, which
    ** points to a BaseTypeIdImpl.  These are simple types that are
    ** intended to be movable to the client, so they don't have
    ** the entire implementation.  We need to wrap them in DataTypeServices
    ** and TypeId objects that contain the full implementations for
    ** language processing.
    */
    TypeDescriptorImpl typeDescriptor = (TypeDescriptorImpl) row.getColumn(SYSCOLUMNS_COLUMNDATATYPE).
                          getObject();
    typeId = typeDescriptor.getTypeId();

    /*
    ** The BaseTypeIdImpl tells what type of TypeId it is supposed to
    ** be wrapped in.
    */
    wrapperTypeId =
      (TypeId) Monitor.newInstanceFromIdentifier(typeId.wrapperTypeFormatId());
    /* Wrap the BaseTypeIdImpl in a full type id */
    wrapperTypeId.setNestedTypeId(typeId);

    /* Wrap the TypeDescriptorImpl in a full DataTypeDescriptor */
    DataTypeDescriptor dataTypeServices = new DataTypeDescriptor(typeDescriptor,
View Full Code Here

    {
        if ( tc == null ) { tc = getTransactionCompile(); }

        if ( dtd == null ) { return null; }

        BaseTypeIdImpl btii = dtd.getTypeId().getBaseTypeId();
        if ( !btii.isAnsiUDT() ) { return null; }

        SchemaDescriptor sd = getSchemaDescriptor( btii.getSchemaName(), tc, true );
        AliasDescriptor ad = getAliasDescriptor
            ( sd.getUUID().toString(), btii.getUnqualifiedName(), AliasInfo.ALIAS_NAME_SPACE_UDT_AS_CHAR );

        return ad;
    }
View Full Code Here

         * a BaseTypeIdImpl. Used to create the static final variables
         * of this class.
         */
        private static TypeId create(int typeFormatId, int implTypeFormatId)
        {
            return new TypeId(typeFormatId, new BaseTypeIdImpl(implTypeFormatId));
        }
View Full Code Here

                {
                  case Types.TINYINT:
                          ret = TINYINT_ID;
                          if (ret == null)
                                  ret = TINYINT_ID = new TypeId(StoredFormatIds.TINYINT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.TINYINT_TYPE_ID_IMPL));
                          break;

                  case Types.SMALLINT:
                          ret = SMALLINT_ID;
                          if (ret == null)
                                  ret = SMALLINT_ID = new TypeId(StoredFormatIds.SMALLINT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.SMALLINT_TYPE_ID_IMPL));
                          break;

                  case Types.INTEGER:
                          return INTEGER_ID;

                  case Types.BIGINT:
                          ret = LONGINT_ID;
                          if (ret == null)
                                  ret = LONGINT_ID = new TypeId(StoredFormatIds.LONGINT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.LONGINT_TYPE_ID_IMPL));
                          break;

                  case Types.REAL:
                          ret = REAL_ID;
                          if (ret == null)
                                  ret = REAL_ID = new TypeId(StoredFormatIds.REAL_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.REAL_TYPE_ID_IMPL));
                          break;

                  case Types.FLOAT:
                  case Types.DOUBLE:
                          ret = DOUBLE_ID;
                          if (ret == null)
                                  ret = DOUBLE_ID = new TypeId(StoredFormatIds.DOUBLE_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.DOUBLE_TYPE_ID_IMPL));
                          break;

                  case Types.DECIMAL:
                          ret = DECIMAL_ID;
                          if (ret == null)
                                  ret = DECIMAL_ID = new TypeId(StoredFormatIds.DECIMAL_TYPE_ID,
                                                                        new DecimalTypeIdImpl());
                          break;

                  case Types.NUMERIC:
                          ret = NUMERIC_ID;
                          if (ret == null) {
                                  DecimalTypeIdImpl numericTypeIdImpl = new DecimalTypeIdImpl();
                                  numericTypeIdImpl.setNumericType();
                                  ret = NUMERIC_ID = new TypeId(StoredFormatIds.DECIMAL_TYPE_ID, numericTypeIdImpl);
                          }
                          break;

                  case Types.CHAR:
                          return CHAR_ID;

                  case Types.VARCHAR:
                          ret = VARCHAR_ID;
                          if (ret == null)
                                  ret = VARCHAR_ID = new TypeId(StoredFormatIds.VARCHAR_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.VARCHAR_TYPE_ID_IMPL));
                          break;

                  case Types.DATE:
                          ret = DATE_ID;
                          if (ret == null)
                                  ret = DATE_ID = new TypeId(StoredFormatIds.DATE_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.DATE_TYPE_ID_IMPL));
                          break;

                  case Types.TIME:
                          ret = TIME_ID;
                          if (ret == null)
                                  ret = TIME_ID = new TypeId(StoredFormatIds.TIME_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.TIME_TYPE_ID_IMPL));
                          break;

                  case Types.TIMESTAMP:
                          ret = TIMESTAMP_ID;
                          if (ret == null)
                                  ret = TIMESTAMP_ID = new TypeId(StoredFormatIds.TIMESTAMP_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.TIMESTAMP_TYPE_ID_IMPL));
                          break;
                  case Types.BIT:
                  case JDBC30Translation.SQL_TYPES_BOOLEAN:
                          return BOOLEAN_ID;

                  case Types.BINARY:
                          ret = BIT_ID;
                          if (ret == null)
                                  ret = BIT_ID = new TypeId(StoredFormatIds.BIT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.BIT_TYPE_ID_IMPL));
                          break;

                  case Types.VARBINARY:
                          ret = VARBIT_ID;
                          if (ret == null)
                                  ret = VARBIT_ID = new TypeId(StoredFormatIds.VARBIT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.VARBIT_TYPE_ID_IMPL));
                          break;

                  case Types.LONGVARBINARY:
                          ret = LONGVARBIT_ID;
                          if (ret == null)
                                  ret = LONGVARBIT_ID = new TypeId(StoredFormatIds.LONGVARBIT_TYPE_ID,
                                                                        new BaseTypeIdImpl(StoredFormatIds.LONGVARBIT_TYPE_ID_IMPL));
                          break;

                  case Types.LONGVARCHAR:
                      ret = LONGVARCHAR_ID;
                      if (ret == null)
                          ret = LONGVARCHAR_ID = new TypeId(StoredFormatIds.LONGVARCHAR_TYPE_ID,
                                                            new BaseTypeIdImpl(StoredFormatIds.LONGVARCHAR_TYPE_ID_IMPL));
                      break;

                  case JDBC20Translation.SQL_TYPES_BLOB:
                      ret = BLOB_ID;
                      if (ret == null)
                          ret = BLOB_ID = new TypeId(StoredFormatIds.BLOB_TYPE_ID,
                                                     new BaseTypeIdImpl(StoredFormatIds.BLOB_TYPE_ID_IMPL));
                      break;
                                               
                  case JDBC20Translation.SQL_TYPES_CLOB:
                      ret = CLOB_ID;
                      if (ret == null)
                          ret = CLOB_ID = new TypeId(StoredFormatIds.CLOB_TYPE_ID,
                                                     new BaseTypeIdImpl(StoredFormatIds.CLOB_TYPE_ID_IMPL));
                      break;

                  // XML is not a JDBC type, so we have to check for our
                  // internal XML type.
                  case StoredFormatIds.XML_TYPE_ID:
                      ret = XML_ID;
                      if (ret == null)
                          ret = XML_ID = new TypeId(StoredFormatIds.XML_TYPE_ID,
                                                     new BaseTypeIdImpl(StoredFormatIds.XML_TYPE_ID_IMPL));
                      break;
                }
                return ret;
        }
View Full Code Here

TOP

Related Classes of org.apache.derby.catalog.types.BaseTypeIdImpl

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.