Package org.apache.ignite.catalog
Class ColumnType<T>
java.lang.Object
org.apache.ignite.catalog.ColumnType<T>
Column types.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ColumnType<Long>BIGINTSQL column type.static final ColumnType<Boolean>BOOLEANSQL column type.static final ColumnType<LocalDate>DATESQL column type.static final ColumnType<BigDecimal>DECIMALSQL column type.static final ColumnType<Double>DOUBLESQL column type.static final ColumnType<Float>32-bit single-precision floating-point number.static final ColumnType<Short>16-bit signed integer.static final ColumnType<Integer>32-bit signed integer.static final ColumnType<Long>64-bit signed integer.static final ColumnType<Byte>8-bit signed integer.static final ColumnType<Integer>INTEGERSQL column type.static final ColumnType<Float>REALSQL column type.static final ColumnType<Short>SMALLINTSQL column type.static final ColumnType<LocalTime>TIMESQL column type.static final ColumnType<LocalDateTime>TIMESTAMPSQL column type.static final ColumnType<Instant>TIMESTAMP WITH LOCAL TIME ZONESQL column type.static final ColumnType<Byte>TINYINTSQL column type.static final ColumnType<UUID>UUIDSQL column type.static final ColumnType<byte[]>VARBINARYSQL column type.static final ColumnType<String>VARCHARSQL column type. -
Method Summary
Modifier and TypeMethodDescriptionstatic ColumnType<BigDecimal>decimal(int precision, int scale) DECIMALwith specified precision and scale.Returns default value expression of the column type.defaultExpression(String expression) Set default value for this column type as an expression.Returns default value of the column type.defaultValue(T value) Set default value for this column type.length()Returns length of the column type.Sets length for this column type.notNull()Sets this type as not nullable.nullable()Returns nullability of the column type.Sets nullability of this type.static ColumnType<?>Creates a column type with the type derived from the Java type and default length, precision, scale and nullability.static ColumnType<?>Creates a column type with the type derived from the Java type and specified length, precision, scale and nullability.Returns precision of the column type.Sets precision for this column type.Sets precision and scale for this column type.scale()Returns scale of the column type.static ColumnType<LocalTime>time(int precision) TIMEwith specified precision.static ColumnType<LocalDateTime>timestamp(int precision) TIMESTAMPwith specified precision.type()Returns Java type of the column type.typeName()Returns SQL type name of the column type.static ColumnType<byte[]>varbinary(int length) VARBINARYwith specified length.static ColumnType<String>varchar(int length) VARCHARwith specified length.
-
Field Details
-
BOOLEAN
BOOLEANSQL column type. -
TINYINT
TINYINTSQL column type. -
SMALLINT
SMALLINTSQL column type. -
INTEGER
INTEGERSQL column type. -
BIGINT
BIGINTSQL column type. -
INT8
8-bit signed integer. An alias forTINYINT. -
INT16
16-bit signed integer. An alias forSMALLINT. -
INT32
32-bit signed integer. An alias forINTEGER. -
INT64
64-bit signed integer. An alias forBIGINT. -
REAL
REALSQL column type. -
FLOAT
32-bit single-precision floating-point number. An alias forREAL. -
DOUBLE
DOUBLESQL column type. -
VARCHAR
VARCHARSQL column type. -
VARBINARY
VARBINARYSQL column type. -
TIME
TIMESQL column type. -
TIMESTAMP
TIMESTAMPSQL column type. -
DATE
DATESQL column type. -
DECIMAL
DECIMALSQL column type. -
UUID
UUIDSQL column type. -
TIMESTAMP_WITH_LOCAL_TIME_ZONE
TIMESTAMP WITH LOCAL TIME ZONESQL column type.
-
-
Method Details
-
varchar
VARCHARwith specified length. -
varbinary
VARBINARYwith specified length. -
time
TIMEwith specified precision. -
timestamp
TIMESTAMPwith specified precision. -
decimal
DECIMALwith specified precision and scale. -
of
public static ColumnType<?> of(Class<?> type, Integer length, Integer precision, Integer scale, Boolean nullable) Creates a column type with the type derived from the Java type and specified length, precision, scale and nullability.- Parameters:
type- Java type from which to derive the column type.length- Length of the character data type.precision- Precision of the numeric data type.scale- Scale of the numeric data type.nullable- Nullability.- Returns:
- Created column type object.
-
of
Creates a column type with the type derived from the Java type and default length, precision, scale and nullability.- Parameters:
type- Java type from which to derive the column type.- Returns:
- Created column type object.
-
type
Returns Java type of the column type.- Returns:
- Java class.
-
typeName
Returns SQL type name of the column type.- Returns:
- Type name.
-
nullable
Returns nullability of the column type.- Returns:
falseif the column is non-nullable.
-
nullable
Sets nullability of this type.- Parameters:
n- Nullable flag.- Returns:
- Copy of the column type object.
-
notNull
Sets this type as not nullable.- Returns:
- Copy of the column type object.
-
defaultValue
Returns default value of the column type.- Returns:
- Default value.
-
defaultValue
Set default value for this column type.- Parameters:
value- Default value.- Returns:
- Copy of the column type object.
-
defaultExpression
Returns default value expression of the column type.- Returns:
- Default value expression.
-
defaultExpression
Set default value for this column type as an expression.- Parameters:
expression- Default value as an expression.- Returns:
- Copy of the column type object.
-
precision
Returns precision of the column type.- Returns:
- Precision.
-
precision
Sets precision for this column type.- Parameters:
precision- Precision.- Returns:
- Copy of the column type object.
-
precision
Sets precision and scale for this column type.- Parameters:
precision- Precision.scale- Scale.- Returns:
- Copy of the column type object.
-
scale
Returns scale of the column type.- Returns:
- Scale.
-
length
Returns length of the column type.- Returns:
- Length.
-
length
Sets length for this column type.- Parameters:
length- Length.- Returns:
- Copy of the column type object.
-