javaee7-samples icon indicating copy to clipboard operation
javaee7-samples copied to clipboard

Creating initial database from multiple SQL files

Open coderoute opened this issue 11 years ago • 3 comments

When creating a Java EE application with integration tests, a database often needs to be bootstrapped. Current examples seem to use a single SQL file referenced from persistence.xml using the javax.persistence.schema-generation.create-script-source property.

However, in practice database schema evolves and it is a common practice to apply these changes to production environments using a series of SQL files representing each change (e.g., using c5-db-migration plugin). Maintaining different SQLs for test purposes and another for production purposes is obviously redundant and error prone. Thus, I will like to see an example a JavaEE app that can populate a test/in-memory database using such list of SQL files.

coderoute avatar Jun 12 '14 15:06 coderoute

@bartoszmajsak something for Arquillian Persistence Extension?

aslakknutsen avatar Jun 12 '14 16:06 aslakknutsen

Yeah we can use APE for that. @coderoute how about working together on this sample?

bartoszmajsak avatar Aug 12 '14 08:08 bartoszmajsak

@bartoszmajsak let me know what you need.

coderoute avatar Aug 14 '14 06:08 coderoute