i am trying to map some classes using some hibernate and arrived at a case where i am unable to find the best way to achieve the solution.
i have three classes namely AirTransport,TrainTransport and RoadTransport and they have certain properties which are getting mapped correctly.
we have to store TRANSPORTTIME entries of these classes but don't want to store time entries of individual classes in there respective tables,
we want to create a TRANSPORTTIME table where we can store time related entries of the above defined three classes.
since these three classes are independent so i am confused how best to map these classes's time entry in to the TRANSPORTTIME table.
i tried to do something like this in the three transport classes
<set name="timeTable" table="TRANSPORTTIME" inverse="true" lazy="true">
<column name="UUID" />
<one-to-many class="TransportTime" />
but not sure how to map the things on the other side i.e TRANSPORT table
any help or pointer in this regard will be helpfull
If you are sure UUID does not have the same value across different Transport, it could work. But I would prefer to use a map instead of a set avoiding to have TransportTime as an entity, but just as a value.