-->
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.  [ 4 posts ] 
Author Message
 Post subject: How can I set parameter for WHERE clause defined by @Where
PostPosted: Tue Oct 16, 2007 12:36 am 
Newbie

Joined: Mon Oct 15, 2007 11:52 pm
Posts: 2
Hibernate version:3.2


I want to make a pre-select for an Entity using @Where annotation.How can I set parameters for SQL WHERE clause defined by @Where.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 16, 2007 2:15 am 
Regular
Regular

Joined: Mon Jan 22, 2007 10:32 am
Posts: 101
I don't think it is supported, i.e. you cannot specify parameters for where clause defined by @Where (in case you find a way to do so, let me know as I am also looking for such a thing for long time)

May be you can make use of filters which can be parameterized.

http://www.hibernate.org/hib_docs/v3/re ... e/#filters


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 16, 2007 3:51 am 
Newbie

Joined: Mon Oct 15, 2007 11:52 pm
Posts: 2
Thanks for reply.

I use Hibernate Entity-Manager , but I can't find the enabledFilter() in em like in session. How can I enabled the Filter and set parameters ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 16, 2007 5:28 am 
Regular
Regular

Joined: Mon Jan 22, 2007 10:32 am
Posts: 101
I have never worked with Entity Manager but I think you can get hold of hibernate session from entity manager by

Session theSession = ((HibernateEntityManager)em).getSession();

and then you can use session apis to enable filters.


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