-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernante Validator Exception when update entity
PostPosted: Fri Sep 12, 2008 6:14 am 
Regular
Regular

Joined: Tue Jun 03, 2008 1:12 pm
Posts: 84
Location: germany
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.