X-Git-Url: https://juplo.de/gitweb/?p=hibernate4-maven-plugin;a=blobdiff_plain;f=src%2Fit%2Fhibernate4-maven-plugin-envers-sample%2FREADME.md;fp=src%2Fit%2Fhibernate4-maven-plugin-envers-sample%2FREADME.md;h=cc048a433775754a0fbecf0c136a2173176686d9;hp=0000000000000000000000000000000000000000;hb=25079f13c0eda6807d5aee67086a21ddde313213;hpb=69458703cddc2aea1f67e06db43bce6950c6f3cb diff --git a/src/it/hibernate4-maven-plugin-envers-sample/README.md b/src/it/hibernate4-maven-plugin-envers-sample/README.md new file mode 100644 index 00000000..cc048a43 --- /dev/null +++ b/src/it/hibernate4-maven-plugin-envers-sample/README.md @@ -0,0 +1,38 @@ +Hibernate-4 maven plugin Envers sample project +==================== + +Introduction +--------------------- + +This is a sample project that can be used to demonstrate the [Hibernate4-maven-plugin](http://juplo.de/hibernate4-maven-plugin/) +in combination with the Hibernate Envers module. + +The Maven pom.xml file contains the definitions to run the Hibernate4-maven-plugin. + +The project code contains a JPA entity, an Envers audit revision entity and +a single integration test using an in-memory HSQLDB database. + +The integration test performs the following actions: + +* Initialize a JTA environment using [Atomikos transaction essentials](http://www.atomikos.com/Main/TransactionsEssentials/) +* Startup an XA datasource +* Run the SQL-script to drop any existing tables in the HSQLDB database (script/drop-tables-hsqldb.sql) +* Run the SQL-script to create the tables in the HSQLDB database (create-tables-hsqldb.sql) + + Note: this script is created by the Hibernate4-maven-plugin + +* Load the Hibernate (and Envers) configuration, including the validation of the database schema +* Persist and update entities that are audited by Hibernate Envers +* Verify the revisions and the audit tables + +Usage +--------------------- + +__Rebuild the SQL-script using the Hibernate4-maven-plugin to create the database__ + + mvn -PcreateHsqlDbScript clean compile hibernate4:export + +__Build and run the integration tests__ + + mvn clean package +