I
- the record ID typeM
- the stored message typeR
- the read request typeT
- the type of used MessageTable
public abstract class JdbcMessageStorage<I,M extends com.google.protobuf.Message,R extends io.spine.server.storage.ReadRequest<I>,T extends MessageTable<I,M>>
extends io.spine.server.storage.AbstractStorage<I,M,R>
Modifier | Constructor and Description |
---|---|
protected |
JdbcMessageStorage(boolean multitenant,
T table) |
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<I> |
index()
Always throws an
UnsupportedOperationException . |
java.util.Optional<M> |
read(R request) |
void |
removeAll(java.lang.Iterable<M> messages)
Removes the given messages from the storage.
|
protected T |
table() |
void |
write(I id,
M record) |
void |
write(M message)
Writes a single message to the storage.
|
void |
writeAll(java.lang.Iterable<M> messages)
Writes the given messages to the storage.
|
protected JdbcMessageStorage(boolean multitenant, T table)
public void write(M message)
If the record with same ID already exists, it's overwritten.
public void writeAll(java.lang.Iterable<M> messages)
If some of the given message IDs already exists, the respective records are overwritten.
public void removeAll(java.lang.Iterable<M> messages)
The messages which are not found are ignored.
protected T table()
public java.util.Iterator<I> index()
UnsupportedOperationException
.