-->
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 based on a collection composite-element property value
PostPosted: Fri Sep 05, 2003 6:20 pm 
Beginner
Beginner

Joined: Fri Sep 05, 2003 6:11 pm
Posts: 34
I'm trying to follow the instructions from the faq

How do a write a query that returns objects based upon a WHERE clause condition applied to their collection elements?

select distinct parent
from Parent parent,
join parent.children child
where child.name = :name



First off, the comma seems to be causing a problem


Second this doesn't work when the collection is mapped using
composite-element
I get the following error:
net.sf.hibernate.QueryException: collection of values in from clause: solohawb0_.notes.elements [select distinct hawb from kls.domain.entity.solo.SoloHawb hawb join hawb.notes note where note.type = :type]


However it does seem to work when the collection is mapped
using one-to-many

Do I have to use on-to-many?
I'd prefer to use a composite-element
as the collection is really of value objects and not of entities


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2003 9:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
First off, the comma seems to be causing a problem


Get rid of it, it is a mistake.

Quote:
Second this doesn't work when the collection is mapped using
composite-element



Get Hibernate 2.1 beta.


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.