Package org.apache.ignite.sql
Interface ColumnMetadata
public interface ColumnMetadata
Interface that provides methods for accessing column metadata.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents a column origin. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intValueprecision()returns when precision is not applicable to the column's type.static final intValuescale()returns when scale is not applicable to the column's type. -
Method Summary
Modifier and TypeMethodDescriptionname()Returns a column name in the result set.booleannullable()Returns a row column nullability flag.@Nullable ColumnMetadata.ColumnOriginorigin()Returns a column origin.intReturns an SQL column precision, orUNDEFINED_PRECISIONif precision is not applicable to the column's type.intscale()Returns an SQL column scale, orUNDEFINED_SCALEif scale is not applicable to the column's type.type()Returns an SQL column type.Class<?>Returns a class of column values.
-
Field Details
-
UNDEFINED_PRECISION
static final int UNDEFINED_PRECISIONValueprecision()returns when precision is not applicable to the column's type.- See Also:
-
UNDEFINED_SCALE
static final int UNDEFINED_SCALEValuescale()returns when scale is not applicable to the column's type. This isInteger.MIN_VALUEand not-1, so it differs fromUNDEFINED_PRECISIONand the two cannot be tested for with the same value.- See Also:
-
-
Method Details
-
name
String name()Returns a column name in the result set.Note: If a row column does not represent any table column, a generated name is used.
- Returns:
- Column name.
-
valueClass
Class<?> valueClass()Returns a class of column values.- Returns:
- Value class.
-
type
ColumnType type()Returns an SQL column type.- Returns:
- Value type.
-
precision
int precision()Returns an SQL column precision, orUNDEFINED_PRECISIONif precision is not applicable to the column's type.- Returns:
- Number of decimal digits for exact numeric types; number of decimal digits in mantissa for approximate numeric types; number
of decimal digits for fractional seconds of datetime types; length in characters for character types; length in bytes for binary
types; length in bits for bit types; 1 for BOOLEAN;
UNDEFINED_PRECISIONif precision is not valid for the type.
-
scale
int scale()Returns an SQL column scale, orUNDEFINED_SCALEif scale is not applicable to the column's type.Note that the two undefined markers differ in value:
UNDEFINED_SCALEisInteger.MIN_VALUEwhileUNDEFINED_PRECISIONis-1.- Returns:
- Number of digits of scale, or
UNDEFINED_SCALEif scale is not applicable to the column's type.
-
nullable
boolean nullable()Returns a row column nullability flag.- Returns:
trueif column is nullable,falseotherwise.
-
origin
Returns a column origin.- Returns:
- Column origin or
nullif not applicable.
-