"lcoetzee" wrote : Hi,
  | 
  | Is it possible to change the @Where clause at runtime, thus implementing 
some kind of polymorphic query on my collection ?
  | 
  | As an example I have the following:
  | 
  |   | @OneToMany(mappedBy = "service")
  |   |         @MapKey(name="id")
  |   |         @Where(clause="topic_type='CMS'")
  |   |         public Map<Integer,Topic> getTopics() {
  |   |                 return topics;
  |   |         }
  | 
  | This retrieves all the topics of type 'CMS'. At runtime I would like to set 
the topic_type to 'DF' for instance, which will return only the topics with 
topic_type  'DF'.  Any suggestions would be welcome.
  | 
  | Regards
  | Louis

Not exactly sure, but couldn't you define an @Interceptor class that defines a 
pointcut around getTopics() then use Reflection to grab the @Where annotation 
and change the topci_type to DF?  Not sure if I'm missing something since I"m 
fairly new to AOP and design but it seems possible at first glance.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3931944#3931944

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3931944


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to