Package org.hibernate.type.descriptor
Class JdbcTypeNameMapper
java.lang.Object
org.hibernate.type.descriptor.JdbcTypeNameMapper
(Badly named) helper for dealing with standard JDBC types as defined by
Types
-
Method Summary
Modifier and TypeMethodDescriptionstatic Integer
getTypeCode
(String typeName) Get the type code as in the static field names defined onTypes
.static String
getTypeName
(Integer typeCode) Get the type name as in the static field names defined onTypes
.static boolean
isStandardTypeCode
(int typeCode) Determine whether the given JDBC type code represents a standard JDBC type ("standard" being those defined onTypes
).static boolean
isStandardTypeCode
(Integer typeCode) Same as call toisStandardTypeCode(int)
-
Method Details
-
isStandardTypeCode
public static boolean isStandardTypeCode(int typeCode) Determine whether the given JDBC type code represents a standard JDBC type ("standard" being those defined onTypes
).- Parameters:
typeCode
- The JDBC type code to check- Returns:
true
to indicate the type code is a standard type code;false
otherwise.- Implementation Note:
Types.OTHER
is also "filtered out" as being non-standard.
-
isStandardTypeCode
Same as call toisStandardTypeCode(int)
- See Also:
-
getTypeName
Get the type name as in the static field names defined onTypes
. If a type code is not recognized, it is reported asUNKNOWN(?)
where '?' is replaced with the given type code.- Parameters:
typeCode
- The type code to find the name for.- Returns:
- The type name.
- API Note:
- Useful for logging.
-
getTypeCode
Get the type code as in the static field names defined onTypes
. If a type name is not recognized,null
is returned.- Parameters:
typeName
- The type name to find the code for.- Returns:
- The type code.
-