Top Description Methods
io.r2dbc.spi

public Interface ReadableMetadata

Known Direct Subinterfaces
io.r2dbc.spi.OutParameterMetadata, io.r2dbc.spi.ColumnMetadata

Represents the metadata for readable object, for example a column of the results returned from a query or OUT parameter as result of running a stored procedure. The implementation of all methods except getName() is optional for drivers. Metadata is optionally available as by-product of statement execution on a best-effort basis.
Since
0.9
See Also
ColumnMetadata, OutParameterMetadata

Method Summary

Modifier and TypeMethod and Description
public default Class<?>

Returns:

the primary Java type or null if the type is not available.
getJavaType
()

Returns the primary Java type.

public String

Returns:

the name of the item
getName
()

Returns the name.

public default Object

Returns:

the native type descriptor that potentially exposes more metadata or null if no native type descriptor is available.
getNativeTypeMetadata
()

Returns the native type descriptor that potentially exposes more metadata.

public default Nullability

Returns:

the nullability of values.
getNullability
()

Returns the nullability of values.

public default Integer

Returns:

the precision or null if the precision is not available.
getPrecision
()

Returns the precision.

public default Integer

Returns:

the scale or null if the scale is not available.
getScale
()

Returns the scale.

public Type

Returns:

the database Type descriptor.
getType
()

Returns the database Type.

Method Detail

getJavaTypeback to summary
public default Class<?> getJavaType()

Returns the primary Java type. This type can be considered the native representation that is used to exchange values with the least loss in precision.

Implementation Notes

Drivers should implement this method. The method should return the actual type and refrain from returning Object.class. The default implementation returns null. Drivers may need to inspect the value and perform parts of decoding to determine the native Java type. This method should be expected to run in non-constant time.

Returns:Class<?>

the primary Java type or null if the type is not available.

Annotations
@Nullable
See Also
Row#get, OutParameters#get
getNameback to summary
public String getName()

Returns the name.

The name does not necessarily reflect the names how they are in the underlying tables but rather how results are represented (e.g. aliased) in the result.

Returns:String

the name of the item

getNativeTypeMetadataback to summary
public default Object getNativeTypeMetadata()

Returns the native type descriptor that potentially exposes more metadata.

Implementation Notes

Drivers should implement this method if they can expose a driver-specific type metadata object exposing additional information. The default implementation returns null.

Returns:Object

the native type descriptor that potentially exposes more metadata or null if no native type descriptor is available.

Annotations
@Nullable
getNullabilityback to summary
public default Nullability getNullability()

Returns the nullability of values.

Implementation Notes

Implementation of this method is optional. The default implementation returns Nullability#UNKNOWN.

Returns:Nullability

the nullability of values.

See Also
Nullability
getPrecisionback to summary
public default Integer getPrecision()

Returns the precision.

For numeric data, this is the maximum precision. For character data, this is the length in characters. For datetime data types, this is the length in bytes required to represent the value (assuming the maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. Returns null for data types where data type size is not applicable or if the precision cannot be provided.

Implementation Notes

Implementation of this method is optional. The default implementation returns null.

Returns:Integer

the precision or null if the precision is not available.

Annotations
@Nullable
getScaleback to summary
public default Integer getScale()

Returns the scale.

This is the number of digits to right of the decimal point. Returns null for data types where the scale is not applicable or if the scale cannot be provided.

Implementation Notes

Implementation of this method is optional. The default implementation returns null.

Returns:Integer

the scale or null if the scale is not available.

Annotations
@Nullable
getTypeback to summary
public Type getType()

Returns the database Type.

Returns:Type

the database Type descriptor.

Since
0.9