Hi,
Does anyone know how to associate, in Hibernate, to two classes via a map of sets:
SortedMap<key,SortedSet>
I have searched the forums and read all the Hibernate doco, but could not find such a thing explained.
To give some context:
Code:
+----------+ has +------+ departs from +---------+
|DealBundle|----------------| Deal |------------------| Airport |
+----------+ 1 0..* +------+ 1 1 +---------+
|1 | 1
| arrives at |
+--------------------------+
I have an object, call it a DealBundle, which has a whole lot of Deal objects. The Deal objects are kept in multiple SortedSets which in turn are in a Map keyed by the departure Airport object.
Code:
public class DealBundle {
public long id;
public SortedMap<Airport,SortedSet<Deal>>
dealsByDepartureAirport;
}
public class Deal {
public long id;
public Airport departureAirport;
public Airport arrivalAirport;
public float totalPrice;
}
public class Airport {
public long id;
public String IATACode;
public String name;
}
I will appreciate any and every bit advice,
Thanks,
Evan