Class CompositeDatabasePopulator
java.lang.Object
org.springframework.r2dbc.connection.init.CompositeDatabasePopulator
- All Implemented Interfaces:
DatabasePopulator
Composite
DatabasePopulator that delegates to a list of given
DatabasePopulator implementations, executing all scripts.- Since:
- 5.3
- Author:
- Dave Syer, Juergen Hoeller, Sam Brannen, Kazuki Shimizu, Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an emptyCompositeDatabasePopulator.CompositeDatabasePopulator(Collection<DatabasePopulator> populators) Create aCompositeDatabasePopulator.CompositeDatabasePopulator(DatabasePopulator... populators) Create aCompositeDatabasePopulatorwith the given populators. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPopulators(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 R2DBCConnection.voidsetPopulators(DatabasePopulator... populators) Specify one or more populators to delegate to.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DatabasePopulator
populate
-
Constructor Details
-
CompositeDatabasePopulator
public CompositeDatabasePopulator()Create an emptyCompositeDatabasePopulator.- See Also:
-
CompositeDatabasePopulator
Create aCompositeDatabasePopulator. with the given populators.- Parameters:
populators- one or more populators to delegate to.
-
CompositeDatabasePopulator
Create aCompositeDatabasePopulatorwith the given populators.- Parameters:
populators- one or more populators to delegate to.
-
-
Method Details
-
setPopulators
Specify one or more populators to delegate to. -
addPopulators
Add one or more populators to the list of delegates. -
populate
Description copied from interface:DatabasePopulatorPopulate, initialize, or clean up the database using the provided R2DBCConnection.- Specified by:
populatein interfaceDatabasePopulator- Parameters:
connection- the R2DBC connection to use to populate the db; already configured and ready to use, must not benull- Returns:
Monothat initiates script execution and is notified upon completion- Throws:
ScriptException- in case of any errors
-