📄 typeid.java
字号:
typePrecedence = TIMESTAMP_PRECEDENCE; javaTypeName = "java.sql.Timestamp"; maxScale = TypeId.TIMESTAMP_SCALE; maxMaxWidth = TypeId.TIMESTAMP_MAXWIDTH; maxPrecision = TypeId.TIMESTAMP_MAXWIDTH; isDateTimeTimeStampTypeId = true; break; case StoredFormatIds.TINYINT_TYPE_ID: maxPrecision = TypeId.TINYINT_PRECISION; maxScale = TypeId.TINYINT_SCALE; typePrecedence = TINYINT_PRECEDENCE; javaTypeName = "java.lang.Integer"; maxMaxWidth = TypeId.TINYINT_MAXWIDTH; isNumericTypeId = true; break; case StoredFormatIds.USERDEFINED_TYPE_ID_V3: if (baseTypeId != null) { setUserTypeIdInfo(); } else { typePrecedence = USER_PRECEDENCE; } maxMaxWidth = -1; isBuiltIn = false; isUserDefinedTypeId = true; break; case StoredFormatIds.VARBIT_TYPE_ID: typePrecedence = VARBIT_PRECEDENCE; javaTypeName = "byte[]"; maxMaxWidth = TypeId.VARBIT_MAXWIDTH; isBitTypeId = true; isConcatableTypeId = true; break; case StoredFormatIds.BLOB_TYPE_ID: typePrecedence = BLOB_PRECEDENCE; // no java type name, can't be used as java object javaTypeName = "byte[]"; //javaTypeName = "java.sql.Blob"; // doesn't work w casting maxMaxWidth = TypeId.BLOB_MAXWIDTH; isBitTypeId = true; isConcatableTypeId = true; isLongConcatableTypeId = true; // ?? isLOBTypeId = true; break; case StoredFormatIds.VARCHAR_TYPE_ID: typePrecedence = VARCHAR_PRECEDENCE; javaTypeName = "java.lang.String"; maxMaxWidth = TypeId.VARCHAR_MAXWIDTH; isStringTypeId = true; isConcatableTypeId = true; break; case StoredFormatIds.CLOB_TYPE_ID: typePrecedence = CLOB_PRECEDENCE; // no java type name, can't be used as java object javaTypeName = "java.lang.String"; //javaTypeName = "java.sql.Clob"; // doesn't work w casting maxMaxWidth = TypeId.CLOB_MAXWIDTH; isStringTypeId = true; isConcatableTypeId = true; isLongConcatableTypeId = true; // ?? isLOBTypeId = true; break; case StoredFormatIds.NCLOB_TYPE_ID: typePrecedence = NCLOB_PRECEDENCE; // no java type name, can't be used as java object javaTypeName = "java.lang.String"; //javaTypeName = "java.sql.Clob"; // doesn't work w casting maxMaxWidth = TypeId.NCLOB_MAXWIDTH; isStringTypeId = true; isConcatableTypeId = true; isLongConcatableTypeId = true; // ?? isLOBTypeId = true; break; case StoredFormatIds.XML_TYPE_ID: typePrecedence = XML_PRECEDENCE; javaTypeName = "org.apache.derby.iapi.types.XML"; maxMaxWidth = TypeId.XML_MAXWIDTH; break; } } /** * JDBC has its own idea of type identifiers which is different from * the Cloudscape internal type ids. The JDBC type ids are defined * as public final static ints in java.sql.Types. This method translates * a Cloudscape internal TypeId to a JDBC type id. For java objects this * returns JAVA_OBJECT in Java2 and OTHER in JDK 1.1. For Boolean datatypes, * this returns Type.BOOLEAN in JDK1.4 and Type.BIT for jdks prior to 1.4 * * @return The JDBC type Id for this type */ public final int getJDBCTypeId() { return baseTypeId.getJDBCTypeId(); } /** * Returns the SQL name of the datatype. If it is a user-defined type, * it returns the full Java path name for the datatype, meaning the * dot-separated path including the package names. * * @return A String containing the SQL name of this type. */ public String getSQLTypeName() { return baseTypeId.getSQLTypeName(); } /** * Tell whether this is a built-in type. * NOTE: There are 3 "classes" of types: * built-in - system provided types which are implemented internally * (int, smallint, etc.) * system built-in - system provided types, independent of implementation * (date, time, etc.) * user types - types implemented outside of the system * (java.lang.Integer, asdf.asdf.asdf, etc.) * * @return true for built-in types, false for user-defined types. */ public final boolean systemBuiltIn() { return baseTypeId.systemBuiltIn(); } /** * Tell whether this is a built-in type. * NOTE: There are 3 "classes" of types: * built-in - system provided types which are implemented internally * (int, smallint, etc.) * system built-in - system provided types, independent of implementation * (date, time, etc.) * user types - types implemented outside of the system * (java.lang.Integer, asdf.asdf.asdf, etc.) * * @return true for built-in types, false for user-defined types. */ public final boolean userType() { return baseTypeId.userType(); } /** * Get the maximum precision of the type. For types with variable * precision, this is an arbitrary high precision. * * @return The maximum precision of the type */ public int getMaximumPrecision() { return maxPrecision; } /** * Get the maximum scale of the type. For types with variable scale, * this is an arbitrary high scale. * * @return The maximum scale of the type */ public int getMaximumScale() { return maxScale; } /** * Set the nested BaseTypeId in this TypeId. */ public void setNestedTypeId(BaseTypeIdImpl typeId) { baseTypeId = typeId; switch (formatId) { case StoredFormatIds.USERDEFINED_TYPE_ID_V3: setUserTypeIdInfo(); } } private void setUserTypeIdInfo() { UserDefinedTypeIdImpl baseUserTypeId = (UserDefinedTypeIdImpl) baseTypeId; typePrecedence = USER_PRECEDENCE; javaTypeName = baseUserTypeId.getClassName(); } /** * For user types, tell whether or not the class name was a * delimited identifier. For all other types, return false. * * @return Whether or not the class name was a delimited identifier. */ public boolean getClassNameWasDelimitedIdentifier() { return classNameWasDelimitedIdentifier; } /** * Does this TypeId represent a TypeId for a StringDataType. * * @return Whether or not this TypeId represents a TypeId for a StringDataType. */ public boolean isStringTypeId() { return isStringTypeId; } /** * Is this a TypeId for DATE/TIME/TIMESTAMP * * @return true if this is a DATE/TIME/TIMESTAMP */ public boolean isDateTimeTimeStampTypeId() { return isDateTimeTimeStampTypeId; } /** * Is this a TypeId for REAL * * @return true if this is a REAL */ public boolean isRealTypeId() { return isRealTypeId; } /** * Is this a TypeId for floating point (REAL/DOUBLE) * * @return true if this is a REAL or DOUBLE */ public boolean isFloatingPointTypeId() { return isFloatingPointTypeId; } /** * Is this a TypeId for DOUBLE * * @return true if this is a DOUBLE */ public boolean isDoubleTypeId() { return isFloatingPointTypeId && (! isRealTypeId); } /** * Is this a fixed string type? * @return true if this is CHAR or NCHAR */ public boolean isFixedStringTypeId() { return ((formatId == StoredFormatIds.CHAR_TYPE_ID)|| (formatId == StoredFormatIds.NATIONAL_CHAR_TYPE_ID)); } /** *Is this a Clob? * @return true if this is CLOB or NCLOB */ public boolean isClobTypeId() { return ((formatId == StoredFormatIds.CLOB_TYPE_ID)|| (formatId == StoredFormatIds.NCLOB_TYPE_ID)); } /** *Is this a Blob? * @return true if this is BLOB */ public boolean isBlobTypeId() { return ((formatId == StoredFormatIds.BLOB_TYPE_ID)); } /** *Is this a LongVarchar? * @return true if this is LongVarchar */ public boolean isLongVarcharTypeId() {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -