Class JdbcTypeNameMapper

java.lang.Object
org.hibernate.type.descriptor.JdbcTypeNameMapper

public final class JdbcTypeNameMapper extends Object
(Badly named) helper for dealing with standard JDBC types as defined by Types
  • 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 on Types).
      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

      public static boolean isStandardTypeCode(Integer typeCode)
      Same as call to isStandardTypeCode(int)
      See Also:
    • getTypeName

      public static String getTypeName(Integer typeCode)
      Get the type name as in the static field names defined on Types. If a type code is not recognized, it is reported as UNKNOWN(?) 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

      public static Integer getTypeCode(String typeName)
      Get the type code as in the static field names defined on Types. If a type name is not recognized, null is returned.
      Parameters:
      typeName - The type name to find the code for.
      Returns:
      The type code.