views:

93

answers:

0

I may be over thinking this one, but I am stuck...

I have an owned one-to-many relationship using AppEngine and JPA. My owning entity, lets call it 'MyList', owns entities of type 'Event'. In other words, every 'MyList' has zero or more 'Event' objects associated with it. I have no problem adding 'Event' objects to a 'MyList', and I have no problem getting back all the 'Event' objects associated with a 'MyList' because they are fetched lazily when I need all of them.

The problem I have is that now I need to get the 'Event' objects back in a certain order (by a time associated with the 'Event'). How can I write a query for an owned relationship when the 'Event' class does not have an owning 'MyList' key to search for?