-->
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: How to write Criteria like elements in hql
PostPosted: Wed Jan 27, 2010 4:56 am 
Newbie

Joined: Thu Jan 19, 2006 1:44 pm
Posts: 7
Hi,
I have a mapping like the following:

<typedef class="xs.persistence.qbc.collection.element.EMapping" name="e"/>

<class name="xs.persistence.qbc.collection.element.C">
<id name="oid" type="java.lang.Long">
<generator class="native"/>
</id>
<property name="f1" type="integer"/>
<map name="es" cascade="persist,save-update">
<key column="C_OID" not-null="true"/>
<map-key column="K" type="string"/>
<element column="E" type="e"/>
</map>
</class>

As shown above, class C has a map of elements of E. I can use the following hql to search for instances of C which contain a specific instance of E:

from C as c where :e in elements(c.es)

Now, my question is how do I make the same query with criteria api?

Regards,
Rice


Top
 Profile  
 
 Post subject: Re: How to write Criteria like elements in hql
PostPosted: Wed Jan 27, 2010 5:43 am 
Newbie

Joined: Thu Jan 19, 2006 1:44 pm
Posts: 7
Then, I find a bug seems telling me that it is impossible to do such kind of query in criteria api. See http://opensource.atlassian.com/project ... se/HHH-869

Regards,
Rice


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.