Enum Class CastType

java.lang.Object
java.lang.Enum<CastType>
org.hibernate.query.sqm.CastType
All Implemented Interfaces:
Serializable, Comparable<CastType>, java.lang.constant.Constable

public enum CastType extends Enum<CastType>
Defines the set of basic types which should be accepted by the cast() function on every platform.

Note that while almost every database supports the ANSI cast() function, the actual type conversions supported vary widely. Therefore, it is sometimes necessary to emulate certain type conversions that we consider "basic". In particular, some databases (looking at you, MySQL and friends) don't have a proper Types.BOOLEAN type, and so type conversions to and from Boolean must be emulated.

See Also:
  • Enum Constant Details

    • STRING

      public static final CastType STRING
    • CLOB

      public static final CastType CLOB
    • BOOLEAN

      public static final CastType BOOLEAN
    • INTEGER_BOOLEAN

      public static final CastType INTEGER_BOOLEAN
    • YN_BOOLEAN

      public static final CastType YN_BOOLEAN
    • TF_BOOLEAN

      public static final CastType TF_BOOLEAN
    • INTEGER

      public static final CastType INTEGER
    • LONG

      public static final CastType LONG
    • FLOAT

      public static final CastType FLOAT
    • DOUBLE

      public static final CastType DOUBLE
    • FIXED

      public static final CastType FIXED
    • DATE

      public static final CastType DATE
    • TIME

      public static final CastType TIME
    • TIMESTAMP

      public static final CastType TIMESTAMP
    • OFFSET_TIMESTAMP

      public static final CastType OFFSET_TIMESTAMP
    • ZONE_TIMESTAMP

      public static final CastType ZONE_TIMESTAMP
    • NULL

      public static final CastType NULL
    • OTHER

      public static final CastType OTHER
  • Method Details

    • values

      public static CastType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CastType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isNumeric

      public boolean isNumeric()