org.springframework.jdbc.datasource.init
Class CompositeDatabasePopulator
java.lang.Object
org.springframework.jdbc.datasource.init.CompositeDatabasePopulator
- All Implemented Interfaces:
- DatabasePopulator
public class CompositeDatabasePopulator
- extends java.lang.Object
- implements DatabasePopulator
DatabasePopulator
implementation that delegates to a list of other
DatabasePopulator implementations, executing all scripts.
- Since:
- 3.1
- Author:
- Dave Syer, Juergen Hoeller
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
populators
private java.util.List<DatabasePopulator> populators
CompositeDatabasePopulator
public CompositeDatabasePopulator()
setPopulators
public void setPopulators(DatabasePopulator... populators)
- Specify a list of populators to delegate to.
addPopulators
public void addPopulators(DatabasePopulator... populators)
- Add a populator to the list of delegates.
populate
public void populate(java.sql.Connection connection)
throws java.sql.SQLException
- Description copied from interface:
DatabasePopulator
- Populate the database using the JDBC connection provided.
- Specified by:
populate
in interface DatabasePopulator
- Parameters:
connection
- the JDBC connection to use to populate the db; already configured and ready to use
- Throws:
java.sql.SQLException
- if an unrecoverable data access exception occurs during database population