-->
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: Use of filter parameter outside of filter conditions
PostPosted: Tue Jan 16, 2007 3:26 pm 
Newbie

Joined: Tue Jan 16, 2007 3:02 pm
Posts: 2
While this is not documented anywhere that I can find, it is in fact possible to use filter parameters in conditions other than those defined in the filter.

For example, one might define a class with the following annotation

Code:
@FilterDef(name = "foo", parameters = {@ParamDef(name = "asOfDate", type = "timestamp")})


If that filter is enabled on the session, queries may be written that use the bind variable :foo.asOfDate.

In fact, it is possible to use this parameter within a class level where annotation. Of course, this all assumes that the filter will always be enabled, and the parameters will always have values for all sessions.

Code:
@Where(clause = ":foo.asOfDate BETWEEN eff_start_dt and eff_end_dt")


The question is... is this a feature or a hack? Can support for this be expected in future releases.

Note that I would like to do something similar to what is being described here http://lists.jboss.org/pipermail/hibernate-dev/2006-September/000294.html


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.