Package org.hibernate.query.sqm
Enum CastType
- java.lang.Object
-
- java.lang.Enum<CastType>
-
- org.hibernate.query.sqm.CastType
-
- All Implemented Interfaces:
Serializable,Comparable<CastType>
public enum CastType extends Enum<CastType>
Defines the set of basic types which should be accepted by thecast()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 properTypes.BOOLEANtype, and so type conversions to and fromBooleanmust be emulated.- See Also:
Dialect.castPattern(CastType, CastType)
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLEANCLOBDATEDOUBLEFIXEDFLOATINTEGERINTEGER_BOOLEANLONGNULLOFFSET_TIMESTAMPOTHERSTRINGTF_BOOLEANTIMETIMESTAMPYN_BOOLEANZONE_TIMESTAMP
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisNumeric()static CastTypevalueOf(String name)Returns the enum constant of this type with the specified name.static CastType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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 Detail
-
values
public static CastType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CastType c : CastType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CastType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
isNumeric
public boolean isNumeric()
-
-