title: How to populate web application with initial data
body: <p>I am writing web application and am wondering what the recommended way is to populate initial data. This is JPA/Hibernate and Spring application and is built by maven. Up to now I've used script which populate database with initial data, started by hand.</p>
  <p>Unit tests work with theirs own data, created in code before each test. My test classes extends <strong>org.springframework.test.jpa.AbstractJpaTests</strong>.</p>
  <p>Finally I'd like to have a maven build which create database form entities (now I need to run application first time to create database, then run script) then populates initial/dictionary data and run unit and integration tests. This process should be fully automated to put this build in CI server (hudson), creating new database from scratch is also appreciate.</p>
  <p>Additional requirement: Database agnostic solution will be most valuable.</p>
  <p><strong>EDIT:</strong> Best example of what I'm looking for is <a href="http://grails.org/Quick+Start#Create%20a%20Domain%20Class" rel="nofollow noreferrer">init closure in BootStrap.groovy</a>.</p>