-->
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.  [ 2 posts ] 
Author Message
 Post subject: how to disable validation when using JPA?
PostPosted: Fri Mar 27, 2009 6:51 am 
Newbie

Joined: Sat Jul 12, 2008 4:25 am
Posts: 8
Hi,

We are currently using Hibernate JPA 3.2.6 together with Hibenate validator. We are using the provided standard validation annotations (like @NotNull, @Max, ...) but also are using our own validation annotations.

We want to turn off auto validation when saving newly created entities, since these entities are in a draft state. The user has to manually correct the entities after saving them. We already found a good description for a solution http://www.nearinfinity.com/blogs/page/ ... hibernate1 , but this isn't directly working when using JPA.

Our first problem is disabling the standard validateEventlistener. we set the property "hibernate.validator.autoregister_listeners" to 2false" in the persistence.xml. But the standard validation is still triggered. We also tried using the JPA annotation @ExcludeDefaultListeners, which also did not disable the standard validation.

Any hints regarding this problem are welcome ;-)

Best regards,
Matthias


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 01, 2009 6:42 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

setting the property to false should work. Maybe you can post your persistence.xml file? You could debug AnnotationConfiguration.buildSessionFactory() to see if what's happening in there. In fact I am wondering which version of Annotations you are using?

--Hardy


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

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.