public class CompositeDatabasePopulator extends Object implements DatabasePopulator
DatabasePopulator
that delegates to a list of given
DatabasePopulator
implementations, executing all scripts.Constructor and Description |
---|
CompositeDatabasePopulator()
Create an empty
CompositeDatabasePopulator . |
CompositeDatabasePopulator(Collection<DatabasePopulator> populators)
Create a
CompositeDatabasePopulator . |
CompositeDatabasePopulator(DatabasePopulator... populators)
Create a
CompositeDatabasePopulator with the given populators. |
Modifier and Type | Method and Description |
---|---|
void |
addPopulators(DatabasePopulator... populators)
Add one or more populators to the list of delegates.
|
reactor.core.publisher.Mono<Void> |
populate(Connection connection)
Populate, initialize, or clean up the database using the
provided R2DBC
Connection . |
void |
setPopulators(DatabasePopulator... populators)
Specify one or more populators to delegate to.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
populate
public CompositeDatabasePopulator()
CompositeDatabasePopulator
.public CompositeDatabasePopulator(Collection<DatabasePopulator> populators)
CompositeDatabasePopulator
. with the given populators.populators
- one or more populators to delegate to.public CompositeDatabasePopulator(DatabasePopulator... populators)
CompositeDatabasePopulator
with the given populators.populators
- one or more populators to delegate to.public void setPopulators(DatabasePopulator... populators)
public void addPopulators(DatabasePopulator... populators)
public reactor.core.publisher.Mono<Void> populate(Connection connection) throws ScriptException
DatabasePopulator
Connection
.populate
in interface DatabasePopulator
connection
- the R2DBC connection to use to populate the db;
already configured and ready to use, must not be null
Mono
that initiates script execution and is
notified upon completionScriptException
- in all other error cases