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: return an object based on attributes of it's children
PostPosted: Thu Jun 02, 2005 7:32 am 
Newbie

Joined: Mon Feb 02, 2004 4:18 pm
Posts: 16
I've got a general question about using HQL. I've got an object called schedule which contains a collection of events. Each event needs to be validated before the schedule can be approved so I have a Boolean flag on the event to determine if it has been passed.

What I need to do is search for the earliest schedule in the database that contains an event that has not been validated, but I can't figure out how to write a query like that! Could anyone point me in (roughly) the right direction on how to write such a query?

The alternative is to search for all schedules and then each event for each schedule and if an event isn't validated then add the schedule to an "incomplete" list and finally sort the list by date. Even writing that down and reading it back feels very wrong and I'm sure I'm missing some elementary database querying skills here :$


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.