Currently I handle javax.persistence.PersistenceException by checking the StackTrace for the occurrence of a constraint name defined in a annotation.
Is there any more elegant way to solve the problem?
Spring Validation makes it quite easy as the ConstraintViolationExceptiongives me the Property Name and the Message defined in the constraint.