How can I map a map?
I have this:
private Map<Integer, Trip> trips = new HashMap<Integer, Trip>();
As mapkey I want the trip id..
The Trip entity is holding the reference to my entity. (the column is in another table).
The trip has a column to my reference id.
How can I do that?
Something like
@MapKeyTable(name="trips")
@MapKeyColumn(name="trip_id")
@OneToMany(joinTable......)
private Map<Integer, Trip> trips = new HashMap<Integer, Trip>();
If trip id is a property of
Trip(saytripId), then you need the following:Other annotations are for more complex cases.