Java EE 7 Database Migrations with Liquibase and WildFly

I have written about other database migration frameworks before but in this article I’d like to cover the Liquibase framework in combination with WildFly as Java EE 7 compatible application server. In the following tutorial, we’re going to write a full Java EE 7 book store application with a few steps and with Liquibase on board to create the database structure and insert example data into the database. Thanks to the WildFly Maven Plug-in we even do not need to download and configure the application server but let Maven and the plug-in do the work for us. ...

July 31, 2014 · 9 min · 1771 words · Micha Kops

Adding multiple EntityListeners to an Entity in JPA 2

The ability to attach lifecycle events to an entity using simple annotations sometimes is a neat feature in the Java Persistence API. The following short snippets demonstrate how to bind and trigger the different available lifecycle events using an embedded derby database and a bunch of annotations. Dependencies I’m using Hibernate as persistence manager here and Derby as an easy to setup database. In the last step we’ll be writing a test that’s why we’ve added JUnit and Hamcrest. ...

February 25, 2013 · 6 min · 1098 words · Micha Kops