org.springframework.jdbc.datasource.init
Class CompositeDatabasePopulator

java.lang.Object
  extended by 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

Field Summary
private  java.util.List<DatabasePopulator> populators
           
 
Constructor Summary
CompositeDatabasePopulator()
           
 
Method Summary
 void addPopulators(DatabasePopulator... populators)
          Add a populator to the list of delegates.
 void populate(java.sql.Connection connection)
          Populate the database using the JDBC connection provided.
 void setPopulators(DatabasePopulator... populators)
          Specify a list of populators to delegate to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

populators

private java.util.List<DatabasePopulator> populators
Constructor Detail

CompositeDatabasePopulator

public CompositeDatabasePopulator()
Method Detail

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