Class SqlTypes


  • public class SqlTypes
    extends Object
    The class that defines the constants that are used to identify generic SQL types. This is an extension of Types that provides type codes for types that Hibernate supports in addition to the standard JDBC types.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ARRAY
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type ARRAY.
      static int BIGINT
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type BIGINT.
      static int BINARY
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type BINARY.
      static int BIT
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type BIT.
      static int BLOB
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type BLOB.
      static int BOOLEAN
      The constant in the Java programming language, somtimes referred to as a type code, that identifies the generic SQL type BOOLEAN.
      static int CHAR
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type CHAR.
      static int CLOB
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type CLOB.
      static int DATALINK
      The constant in the Java programming language, somtimes referred to as a type code, that identifies the generic SQL type DATALINK.
      static int DATE
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type DATE.
      static int DECIMAL
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type DECIMAL.
      static int DISTINCT
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type DISTINCT.
      static int DOUBLE
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type DOUBLE.
      static int FLOAT
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type FLOAT.
      static int GEOMETRY
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type GEOMETRY.
      static int INET
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type INET for IPv4 or IPv6 addresses.
      static int INTEGER
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type INTEGER.
      static int INTERVAL_SECOND
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type INTERVAL SECOND for a temporal amount in terms of seconds and fractional seconds.
      static int JAVA_OBJECT
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type JAVA_OBJECT.
      static int JSON
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type JSON.
      static int LONG32NVARCHAR
      A type code used internally by the Hibernate Dialect to identify an NVARCHAR-like type large enough to hold any Java string.
      static int LONG32VARBINARY
      A type code used internally by the Hibernate Dialect to identify a VARBINARY-like type large enough to hold any Java byte array.
      static int LONG32VARCHAR
      A type code used internally by the Hibernate Dialect to identify a VARCHAR-like type large enough to hold any Java string.
      static int LONGNVARCHAR
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type LONGNVARCHAR.
      static int LONGVARBINARY
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type LONGVARBINARY.
      static int LONGVARCHAR
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type LONGVARCHAR.
      static int NCHAR
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type NCHAR
      static int NCLOB
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type NCLOB.
      static int NULL
      The constant in the Java programming language that identifies the generic SQL value NULL.
      static int NUMERIC
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type NUMERIC.
      static int NVARCHAR
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type NVARCHAR.
      static int OTHER
      The constant in the Java programming language that indicates that the SQL type is database-specific and gets mapped to a Java object that can be accessed via the methods getObject and setObject.
      static int POINT
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type POINT.
      static int REAL
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type REAL.
      static int REF
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type REF.
      static int REF_CURSOR
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type REF CURSOR.
      static int ROWID
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type ROWID
      static int SMALLINT
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type SMALLINT.
      static int SQLXML
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type XML.
      static int STRUCT
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type STRUCT.
      static int TIME
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type TIME.
      static int TIME_WITH_TIMEZONE
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type TIME WITH TIMEZONE.
      static int TIMESTAMP
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type TIMESTAMP.
      static int TIMESTAMP_UTC
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type TIMESTAMP_UTC.
      static int TIMESTAMP_WITH_TIMEZONE
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type TIMESTAMP WITH TIMEZONE.
      static int TINYINT
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type TINYINT.
      static int UUID
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type UUID.
      static int VARBINARY
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type VARBINARY.
      static int VARCHAR
      The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type VARCHAR.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean hasDatePart​(int typeCode)
      Does the given typecode represent a SQL date or timestamp type?
      static boolean hasTimePart​(int typeCode)
      Does the given typecode represent a SQL time or timestamp type?
      static boolean isCharacterType​(int sqlType)
      Does the given JDBC type code represent some sort of character string type?
      static boolean isFloatOrRealOrDouble​(int typeCode)
      Does the given typecode represent a SQL floating point type?
      static boolean isIntegral​(int typeCode)
      Does the given typecode represent a SQL integer type?
      static boolean isNumericOrDecimal​(int typeCode)
      Does the given typecode represent one of the two SQL decimal types?
      static boolean isNumericType​(int sqlType)
      Does the given JDBC type code represent some sort of numeric type?
      static boolean isTemporalType​(int typeCode)
      Does the given typecode represent a SQL date, time, or timestamp type?
      static boolean isVarbinaryType​(int sqlType)
      Does the given JDBC type code represent some sort of variable-length binary string type?
      static boolean isVarcharType​(int sqlType)
      Does the given JDBC type code represent some sort of variable-length character string type?
    • Field Detail

      • BIT

        public static final int BIT

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type BIT.

        See Also:
        Types.BIT, Constant Field Values
      • TINYINT

        public static final int TINYINT

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type TINYINT.

        See Also:
        Types.TINYINT, Constant Field Values
      • SMALLINT

        public static final int SMALLINT

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type SMALLINT.

        See Also:
        Types.SMALLINT, Constant Field Values
      • INTEGER

        public static final int INTEGER

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type INTEGER.

        See Also:
        Types.INTEGER, Constant Field Values
      • BIGINT

        public static final int BIGINT

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type BIGINT.

        See Also:
        Types.BIGINT, Constant Field Values
      • FLOAT

        public static final int FLOAT

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type FLOAT.

        See Also:
        Types.FLOAT, Constant Field Values
      • REAL

        public static final int REAL

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type REAL.

        See Also:
        Types.REAL, Constant Field Values
      • DOUBLE

        public static final int DOUBLE

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type DOUBLE.

        See Also:
        Types.DOUBLE, Constant Field Values
      • NUMERIC

        public static final int NUMERIC

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type NUMERIC.

        See Also:
        Types.NUMERIC, Constant Field Values
      • DECIMAL

        public static final int DECIMAL

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type DECIMAL.

        See Also:
        Types.DECIMAL, Constant Field Values
      • CHAR

        public static final int CHAR

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type CHAR.

        See Also:
        Types.CHAR, Constant Field Values
      • VARCHAR

        public static final int VARCHAR

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type VARCHAR.

        See Also:
        Types.VARCHAR, Constant Field Values
      • LONGVARCHAR

        public static final int LONGVARCHAR

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type LONGVARCHAR.

        Interpreted by Hibernate as a VARCHAR-like type large enough to hold a string of maximum length Length.LONG.

        See Also:
        Length.LONG, Types.LONGVARCHAR, Constant Field Values
      • DATE

        public static final int DATE

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type DATE.

        See Also:
        Types.DATE, Constant Field Values
      • TIME

        public static final int TIME

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type TIME.

        See Also:
        Types.TIME, Constant Field Values
      • TIMESTAMP

        public static final int TIMESTAMP

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type TIMESTAMP.

        See Also:
        Types.TIMESTAMP, Constant Field Values
      • BINARY

        public static final int BINARY

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type BINARY.

        See Also:
        Types.BINARY, Constant Field Values
      • VARBINARY

        public static final int VARBINARY

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type VARBINARY.

        See Also:
        Types.VARBINARY, Constant Field Values
      • LONGVARBINARY

        public static final int LONGVARBINARY

        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type LONGVARBINARY.

        Interpreted by Hibernate as a VARBINARY-like type large enough to hold a byte array of maximum length Length.LONG.

        See Also:
        Length.LONG, Types.LONGVARBINARY, Constant Field Values
      • NULL

        public static final int NULL

        The constant in the Java programming language that identifies the generic SQL value NULL.

        See Also:
        Types.NULL, Constant Field Values
      • OTHER

        public static final int OTHER
        The constant in the Java programming language that indicates that the SQL type is database-specific and gets mapped to a Java object that can be accessed via the methods getObject and setObject.
        See Also:
        Types.OTHER, Constant Field Values
      • JAVA_OBJECT

        public static final int JAVA_OBJECT
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type JAVA_OBJECT.
        See Also:
        Types.JAVA_OBJECT, Constant Field Values
      • DISTINCT

        public static final int DISTINCT
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type DISTINCT.
        See Also:
        Types.DISTINCT, Constant Field Values
      • STRUCT

        public static final int STRUCT
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type STRUCT.
        See Also:
        Types.STRUCT, Constant Field Values
      • ARRAY

        public static final int ARRAY
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type ARRAY.
        See Also:
        Types.ARRAY, Constant Field Values
      • BLOB

        public static final int BLOB
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type BLOB.
        See Also:
        Types.ARRAY, Constant Field Values
      • CLOB

        public static final int CLOB
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type CLOB.
        See Also:
        Types.CLOB, Constant Field Values
      • REF

        public static final int REF
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type REF.
        See Also:
        Types.REF, Constant Field Values
      • DATALINK

        public static final int DATALINK
        The constant in the Java programming language, somtimes referred to as a type code, that identifies the generic SQL type DATALINK.
        See Also:
        Types.DATALINK, Constant Field Values
      • BOOLEAN

        public static final int BOOLEAN
        The constant in the Java programming language, somtimes referred to as a type code, that identifies the generic SQL type BOOLEAN.
        See Also:
        Types.BOOLEAN, Constant Field Values
      • ROWID

        public static final int ROWID
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type ROWID
        See Also:
        Types.ROWID, Constant Field Values
      • NCHAR

        public static final int NCHAR
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type NCHAR
        See Also:
        Types.NCHAR, Constant Field Values
      • NVARCHAR

        public static final int NVARCHAR
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type NVARCHAR.
        See Also:
        Types.NVARCHAR, Constant Field Values
      • LONGNVARCHAR

        public static final int LONGNVARCHAR
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type LONGNVARCHAR.

        Interpreted by Hibernate as an NVARCHAR-like type large enough to hold a string of maximum length Length.LONG.

        See Also:
        Length.LONG, Types.LONGNVARCHAR, Constant Field Values
      • NCLOB

        public static final int NCLOB
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type NCLOB.
        See Also:
        Types.NCLOB, Constant Field Values
      • SQLXML

        public static final int SQLXML
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type XML.
        See Also:
        Types.SQLXML, Constant Field Values
      • REF_CURSOR

        public static final int REF_CURSOR
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type REF CURSOR.
        See Also:
        Types.REF_CURSOR, Constant Field Values
      • TIME_WITH_TIMEZONE

        public static final int TIME_WITH_TIMEZONE
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type TIME WITH TIMEZONE.
        See Also:
        Types.TIME_WITH_TIMEZONE, Constant Field Values
      • TIMESTAMP_WITH_TIMEZONE

        public static final int TIMESTAMP_WITH_TIMEZONE
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type TIMESTAMP WITH TIMEZONE.
        See Also:
        Types.TIMESTAMP_WITH_TIMEZONE, Constant Field Values
      • UUID

        public static final int UUID
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type UUID.
        See Also:
        Constant Field Values
      • JSON

        public static final int JSON
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type JSON.
        See Also:
        Constant Field Values
      • INET

        public static final int INET
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type INET for IPv4 or IPv6 addresses.
        See Also:
        Constant Field Values
      • TIMESTAMP_UTC

        public static final int TIMESTAMP_UTC
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type TIMESTAMP_UTC.
        See Also:
        Constant Field Values
      • INTERVAL_SECOND

        public static final int INTERVAL_SECOND
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type INTERVAL SECOND for a temporal amount in terms of seconds and fractional seconds.
        See Also:
        Constant Field Values
      • GEOMETRY

        public static final int GEOMETRY
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type GEOMETRY.
        See Also:
        Constant Field Values
      • POINT

        public static final int POINT
        The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type POINT.
        See Also:
        Constant Field Values
    • Method Detail

      • isNumericType

        public static boolean isNumericType​(int sqlType)
        Does the given JDBC type code represent some sort of numeric type?
        Parameters:
        sqlType - a JDBC type code from Types
      • isCharacterType

        public static boolean isCharacterType​(int sqlType)
        Does the given JDBC type code represent some sort of character string type?
        Parameters:
        sqlType - a JDBC type code from Types
      • isVarcharType

        public static boolean isVarcharType​(int sqlType)
        Does the given JDBC type code represent some sort of variable-length character string type?
        Parameters:
        sqlType - a JDBC type code from Types
      • isVarbinaryType

        public static boolean isVarbinaryType​(int sqlType)
        Does the given JDBC type code represent some sort of variable-length binary string type?
        Parameters:
        sqlType - a JDBC type code from Types
      • isNumericOrDecimal

        public static boolean isNumericOrDecimal​(int typeCode)
        Does the given typecode represent one of the two SQL decimal types?
        Parameters:
        typeCode - a JDBC type code from Types
      • isFloatOrRealOrDouble

        public static boolean isFloatOrRealOrDouble​(int typeCode)
        Does the given typecode represent a SQL floating point type?
        Parameters:
        typeCode - a JDBC type code from Types
      • isIntegral

        public static boolean isIntegral​(int typeCode)
        Does the given typecode represent a SQL integer type?
        Parameters:
        typeCode - a JDBC type code from Types
      • isTemporalType

        public static boolean isTemporalType​(int typeCode)
        Does the given typecode represent a SQL date, time, or timestamp type?
        Parameters:
        typeCode - a JDBC type code from Types
      • hasDatePart

        public static boolean hasDatePart​(int typeCode)
        Does the given typecode represent a SQL date or timestamp type?
        Parameters:
        typeCode - a JDBC type code from Types
      • hasTimePart

        public static boolean hasTimePart​(int typeCode)
        Does the given typecode represent a SQL time or timestamp type?
        Parameters:
        typeCode - a JDBC type code from Types