Hibernate version: Hibernate Core 3.2.2.ga Annotations 3.3.0.ga Validator 3.3.0.ga
Hi all,
I want to make automatic validations of unique constraints of our Entitie's tables.
I define the table of the entity like this:
Code:
@Table(name = "rutas", uniqueConstraints = { @UniqueConstraint(columnNames = {
"numero", "planta_id" }) })
And I want to use the information given in the
@UniceConstraint to validate before saving the entity if the constraint would be violated. My validator class
has access to columns forming a unique constraint via the annotation, but I need to translate such columns to property names in order to do my query. Is there any easy/standard way to do such check?
Thanks in advance
Miguel