-->
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: many-to-many problem
PostPosted: Wed Jan 07, 2009 6:10 am 
Newbie

Joined: Sun Dec 07, 2008 1:29 pm
Posts: 6
Hi,

I defined a many-to-many relationship. The reference resolution works ok e.g. if I select all elements on one end I can navigate to the other end via the corresponding properties.

However, if I do a named Hibernate SQL query, the join table appears empty???

Has anyone had this problem? way to troubleshoot this?

i.e.

- "select * from Customer" I get all Customers then I can do getOrders().get(0).getProducts() will show all products purchased in Order [i]. This works perfectly.

- Conversely this named query show no results
<query name="Customer.findByCrap">
<![CDATA[SELECT c1
FROM Customer c1
WHERE c1.id IN
(SELECT c2.id
FROM Customer c2
inner join c2.orders o
inner join o.products p
)
]]>
</query>

TIA,
regards,
Giovanni


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.