@Internal
public final class ColumnReaderFactory
extends java.lang.Object
ColumnReader
instances.Modifier and Type | Method and Description |
---|---|
static <I> ColumnReader<I> |
idReader(java.lang.String columnName,
java.lang.Class<I> idType)
Creates a reader for the column storing index values.
|
static ColumnReader<java.lang.Integer> |
intReader(java.lang.String columnName) |
static <M extends com.google.protobuf.Message> |
messageReader(java.lang.String columnName,
com.google.protobuf.Descriptors.Descriptor messageDescriptor)
Creates a reader for the column storing serialized Protobuf messages.
|
public static <I> ColumnReader<I> idReader(java.lang.String columnName, java.lang.Class<I> idType)
The index values are stored in the DB differently from the other column values, for
example a Protobuf Message
is serialized to JSON instead of bytes
.
I
- the compile-time type of the IDs stored in the columncolumnName
- the name of the column to create the reader foridType
- the class of the IDs stored by the columnColumnReader
instance for the given columnpublic static <M extends com.google.protobuf.Message> io.spine.server.storage.jdbc.query.MessageBytesColumnReader<M> messageReader(java.lang.String columnName, com.google.protobuf.Descriptors.Descriptor messageDescriptor)
M
- the compile-time type of the messages stored in the columncolumnName
- the name of the column to create the reader formessageDescriptor
- the descriptor of the column message typeColumnReader
for the given columnpublic static ColumnReader<java.lang.Integer> intReader(java.lang.String columnName)