I have a Trip and Leg tables. They are related as : One Trip can have 1 or more Legs. And Leg has fields: DepartTime, ArrivalTime, From, To.
I want to Fetch All Trips, and with in each Trip I require only the First Leg (Leg with LeastDeparttime).
How could I write a HQL query for this ?
My Trip Class contains a Set (Collection) of Legs.