-->
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: Query with parameters in the <class where="some quer
PostPosted: Tue Sep 05, 2006 5:12 am 
Newbie

Joined: Tue Sep 05, 2006 5:03 am
Posts: 1
Hi All,

I have got a class mapped to a table and I need to always have something in the where clause when a query is run against this class/table.

I'm using the property "where" in the class element to do that. The problem is that this criteria must be able to receive parameters and I'm not quite sure how to bind the parameter value to the query before loading the object.

It is something like the following:

<class name="test.Facility" table="facility" where="credit_limit > ?">

Is there a way to set it before calling load? Or should I use a different method?

Any help will be much appreciated.
MJ


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 30, 2006 5:35 am 
Newbie

Joined: Thu Dec 08, 2005 12:19 pm
Posts: 6
I believe that you want to use a Filter for this. I haven't gotten it to work myself... actually I'm trying to just get the 'where="some sql here"' to work when I'm doing projection queries. Anyway, here's a URL

http://www.hibernate.org/hib_docs/v3/re ... lters.html


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.