This is really strange!
I have a entity "user" and use the Hibernate Validator for the row "name". The Validator works and persisting a new entity "user" does also work.
Now I want to change some attributes (without validator) on an existing user:
Code:
..
user.setLog(true);
entityManager.merge(user);
entityManager.flush();
..
Hibernate Validator complains:
Code:
Caused by: org.hibernate.validator.InvalidStateException: validation failed for: com.boewe.space.regionA.Users
at org.hibernate.validator.event.ValidateEventListener.validate(ValidateEventListener.java:143)
at org.hibernate.validator.event.ValidateEventListener.onPreUpdate(ValidateEventListener.java:172)
at org.hibernate.action.EntityUpdateAction.preUpdate(EntityUpdateAction.java:217)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:65)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
The strange thing is, that the value, which is invalid is a value which has a validator, that is the row "name". But I do not want to change the "name"-Value, I only want to change a value which has no validator!!
When I remove the validator, then ALL works. What is the problem?