-->
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.  [ 3 posts ] 
Author Message
 Post subject: Using EntityManager in custom constraint
PostPosted: Sun Dec 26, 2010 7:03 am 
Newbie

Joined: Sun Oct 17, 2010 3:55 am
Posts: 2
Hi,

I would like to create a custom JSR 303 custom validation constraint. This constraint will have to use the hibernate EntityManager.

Is there a way to have it automatically injected or available for the constraint validator ?

Thanks.


Top
 Profile  
 
 Post subject: Re: Using EntityManager in custom constraint
PostPosted: Wed Dec 29, 2010 1:47 pm 
Hibernate Team
Hibernate Team

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

what's your use case? I recommend you have a look at http://community.jboss.org/wiki/Accessi ... tValidator which shows a way to have ConstraintValidator instances which are session aware. This approach should be adaptable for JPA.

If you are after something else you can maybe describe in more detail what you want to do.

--Hardy


Top
 Profile  
 
 Post subject: Re: Using EntityManager in custom constraint
PostPosted: Wed Jan 05, 2011 5:09 pm 
Newbie

Joined: Sun Oct 17, 2010 3:55 am
Posts: 2
Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.