Package ortus.boxlang.runtime.types
Enum Class QueryColumnType
- All Implemented Interfaces:
Serializable,Comparable<QueryColumnType>,Constable
Represents a column type in a Query object.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intThe SQL type associated with this QueryColumnType. -
Method Summary
Modifier and TypeMethodDescriptionstatic QueryColumnTypefromSQLType(int type) Acquire a QueryColumnType from a SQL type.static QueryColumnTypefromString(String type) Create a new QueryColumnType from a string value.static booleanisStringType(QueryColumnType type) Does this represent a type that can be treated as a string?static ObjecttoSQLType(QueryColumnType type, Object value, IBoxContext context) Convert a value to the appropriate SQL type.toString()Retrieve this QueryColumnType as a string value.static QueryColumnTypeReturns the enum constant of this class with the specified name.static QueryColumnType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BIGINT
-
BINARY
-
BOOLEAN
-
BIT
-
CHAR
-
DATE
-
DATETIME
-
DECIMAL
-
DOUBLE
-
INTEGER
-
NULL
-
OBJECT
-
OTHER
-
TIME
-
TIMESTAMP
-
VARCHAR
-
-
Field Details
-
sqlType
public final int sqlTypeThe SQL type associated with this QueryColumnType.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
fromString
Create a new QueryColumnType from a string value. -
toString
Retrieve this QueryColumnType as a string value.- Overrides:
toStringin classEnum<QueryColumnType>
-
fromSQLType
Acquire a QueryColumnType from a SQL type. Useful for assembling Query objects from JDBC result sets.- Parameters:
type- The SQL type to convert.- Returns:
- The QueryColumnType corresponding to the SQL type.
-
toSQLType
Convert a value to the appropriate SQL type.- Parameters:
type- The query column type to convert to.value- The value to convert.context- The context in which the conversion is taking place. Useful for localization.
-
isStringType
Does this represent a type that can be treated as a string?- Parameters:
type- The type to check.- Returns:
- true if the type can be treated as a string.
-