Articles Tagged ‘java persistence api’

Adding multiple EntityListeners to an Entity in JPA 2

Monday, February 25th, 2013

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.

(more…)

Bean Validation with JSR-303 and Hibernate Validator

Tuesday, December 14th, 2010

You want to add some validation logic to your Java beans? You want to achieve this with some shiny extendable annotations? Then give the Java Bean Validation standard aka JSR-303 a try..

We’re going to use the reference implementation for bean validation, Hibernate Validator in this tutorial but there are also links to other alternatives like Oval or Apache Bean Validation.

So let’s begin and validate some stuff ..
(more…)

Search
Categories