public static class JdbcProjectionStorage.Builder<I> extends StorageBuilder<JdbcProjectionStorage.Builder<I>,JdbcProjectionStorage<I>>
JdbcProjectionStorage
.Modifier and Type | Method and Description |
---|---|
protected void |
checkPreconditions()
Checks the preconditions of the storage construction.
|
JdbcProjectionStorage<I> |
doBuild()
Builds a new instance of the
Storage . |
java.lang.Class<? extends io.spine.server.projection.Projection<I,?,?>> |
getProjectionClass() |
JdbcRecordStorage<I> |
getRecordStorage() |
protected JdbcProjectionStorage.Builder<I> |
getThis()
Returns current instance of
StorageBuilder . |
JdbcProjectionStorage.Builder<I> |
setProjectionClass(java.lang.Class<? extends io.spine.server.projection.Projection<I,?,?>> projectionClass)
Sets the class of projections to be stored.
|
JdbcProjectionStorage.Builder<I> |
setRecordStorage(JdbcRecordStorage<I> recordStorage)
Sets a
RecordStorage to store projection instances. |
build, getDataSource, getTypeMapping, isMultitenant, setDataSource, setMultitenant, setTypeMapping
protected JdbcProjectionStorage.Builder<I> getThis()
StorageBuilder
StorageBuilder
.
Used in setters to avoid extra unchecked casts.
getThis
in class StorageBuilder<JdbcProjectionStorage.Builder<I>,JdbcProjectionStorage<I>>
StorageBuilder.this
referencepublic JdbcRecordStorage<I> getRecordStorage()
public JdbcProjectionStorage.Builder<I> setRecordStorage(JdbcRecordStorage<I> recordStorage)
RecordStorage
to store projection instances.protected void checkPreconditions() throws java.lang.IllegalStateException
Default implementation checks that the field StorageBuilder.dataSource
was set to a non-null value.
Override this method to modify these preconditions.
The JdbcProjectionStorage.Builder
checks the recordStorage
and
queryFactory
fields to be set.
checkPreconditions
in class StorageBuilder<JdbcProjectionStorage.Builder<I>,JdbcProjectionStorage<I>>
java.lang.IllegalStateException
- upon a precondition violationpublic JdbcProjectionStorage<I> doBuild()
StorageBuilder
Storage
.
The construction preconditions are checked before calling this method.
doBuild
in class StorageBuilder<JdbcProjectionStorage.Builder<I>,JdbcProjectionStorage<I>>
Storage
.public JdbcProjectionStorage.Builder<I> setProjectionClass(java.lang.Class<? extends io.spine.server.projection.Projection<I,?,?>> projectionClass)
public java.lang.Class<? extends io.spine.server.projection.Projection<I,?,?>> getProjectionClass()