Class ColumnType<T>

java.lang.Object
org.apache.ignite.catalog.ColumnType<T>

public class ColumnType<T> extends Object
Column types.
  • Field Details

    • BOOLEAN

      public static final ColumnType<Boolean> BOOLEAN
      BOOLEAN SQL column type.
    • TINYINT

      public static final ColumnType<Byte> TINYINT
      TINYINT SQL column type.
    • SMALLINT

      public static final ColumnType<Short> SMALLINT
      SMALLINT SQL column type.
    • INTEGER

      public static final ColumnType<Integer> INTEGER
      INTEGER SQL column type.
    • BIGINT

      public static final ColumnType<Long> BIGINT
      BIGINT SQL column type.
    • INT8

      public static final ColumnType<Byte> INT8
      8-bit signed integer. An alias for TINYINT.
    • INT16

      public static final ColumnType<Short> INT16
      16-bit signed integer. An alias for SMALLINT.
    • INT32

      public static final ColumnType<Integer> INT32
      32-bit signed integer. An alias for INTEGER.
    • INT64

      public static final ColumnType<Long> INT64
      64-bit signed integer. An alias for BIGINT.
    • REAL

      public static final ColumnType<Float> REAL
      REAL SQL column type.
    • FLOAT

      public static final ColumnType<Float> FLOAT
      32-bit single-precision floating-point number. An alias for REAL.
    • DOUBLE

      public static final ColumnType<Double> DOUBLE
      DOUBLE SQL column type.
    • VARCHAR

      public static final ColumnType<String> VARCHAR
      VARCHAR SQL column type.
    • VARBINARY

      public static final ColumnType<byte[]> VARBINARY
      VARBINARY SQL column type.
    • TIME

      public static final ColumnType<LocalTime> TIME
      TIME SQL column type.
    • TIMESTAMP

      public static final ColumnType<LocalDateTime> TIMESTAMP
      TIMESTAMP SQL column type.
    • DATE

      public static final ColumnType<LocalDate> DATE
      DATE SQL column type.
    • DECIMAL

      public static final ColumnType<BigDecimal> DECIMAL
      DECIMAL SQL column type.
    • UUID

      public static final ColumnType<UUID> UUID
      UUID SQL column type.
    • TIMESTAMP_WITH_LOCAL_TIME_ZONE

      public static final ColumnType<Instant> TIMESTAMP_WITH_LOCAL_TIME_ZONE
      TIMESTAMP WITH LOCAL TIME ZONE SQL column type.
  • Method Details

    • varchar

      public static ColumnType<String> varchar(int length)
      VARCHAR with specified length.
    • varbinary

      public static ColumnType<byte[]> varbinary(int length)
      VARBINARY with specified length.
    • time

      public static ColumnType<LocalTime> time(int precision)
      TIME with specified precision.
    • timestamp

      public static ColumnType<LocalDateTime> timestamp(int precision)
      TIMESTAMP with specified precision.
    • decimal

      public static ColumnType<BigDecimal> decimal(int precision, int scale)
      DECIMAL with 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

      public static ColumnType<?> of(Class<?> type)
      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

      public Class<T> type()
      Returns Java type of the column type.
      Returns:
      Java class.
    • typeName

      public String typeName()
      Returns SQL type name of the column type.
      Returns:
      Type name.
    • nullable

      public Boolean nullable()
      Returns nullability of the column type.
      Returns:
      false if the column is non-nullable.
    • nullable

      public ColumnType<T> nullable(Boolean n)
      Sets nullability of this type.
      Parameters:
      n - Nullable flag.
      Returns:
      Copy of the column type object.
    • notNull

      public ColumnType<T> notNull()
      Sets this type as not nullable.
      Returns:
      Copy of the column type object.
    • defaultValue

      public T defaultValue()
      Returns default value of the column type.
      Returns:
      Default value.
    • defaultValue

      public ColumnType<T> defaultValue(T value)
      Set default value for this column type.
      Parameters:
      value - Default value.
      Returns:
      Copy of the column type object.
    • defaultExpression

      public String defaultExpression()
      Returns default value expression of the column type.
      Returns:
      Default value expression.
    • defaultExpression

      public ColumnType<T> defaultExpression(String expression)
      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

      public Integer precision()
      Returns precision of the column type.
      Returns:
      Precision.
    • precision

      public ColumnType<T> precision(Integer precision)
      Sets precision for this column type.
      Parameters:
      precision - Precision.
      Returns:
      Copy of the column type object.
    • precision

      public ColumnType<T> precision(Integer precision, Integer scale)
      Sets precision and scale for this column type.
      Parameters:
      precision - Precision.
      scale - Scale.
      Returns:
      Copy of the column type object.
    • scale

      public Integer scale()
      Returns scale of the column type.
      Returns:
      Scale.
    • length

      public Integer length()
      Returns length of the column type.
      Returns:
      Length.
    • length

      public ColumnType<T> length(Integer length)
      Sets length for this column type.
      Parameters:
      length - Length.
      Returns:
      Copy of the column type object.