-->
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.  [ 3 posts ] 
Author Message
 Post subject: Searching attributes in objects that are in collections
PostPosted: Wed Mar 01, 2006 7:08 pm 
Newbie

Joined: Mon Sep 12, 2005 11:02 am
Posts: 4
I've got an object called ChangedSection that contains a Revision. The Revision contains a set of Statuses. A Status has a String that may be "Open" or "Closed".

I basically want all ChangedSections that contain a Revision with a status of open.

I want to do something like this:

from com.company.ChangedSection as changedSection where changedSection.revision.status.name='Open'

Is is possible to search for attributes contained within an object that is in a collection?


Top
 Profile  
 
 Post subject: ...
PostPosted: Wed Mar 01, 2006 7:16 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
perhaps like this:

from com.company.ChangedSection as changedSection
join changedSection.revision as r
join r.statuses as s
where s.name='Open'

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject: Re: ...
PostPosted: Thu Mar 02, 2006 1:51 pm 
Newbie

Joined: Mon Sep 12, 2005 11:02 am
Posts: 4
kgignatyev wrote:
perhaps like this:

from com.company.ChangedSection as changedSection
join changedSection.revision as r
join r.statuses as s
where s.name='Open'


The join did the trick! Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.