I'm trying to create a set of tables that will handle a situation where I have been given a class "Event" with a corresponding table containing simple properties. I am extending Event with CompositeEvent which does 2 things: 1, contain several Events and 2, provide a little extra information. So essentially it should look like:
Event [ ID, organizer ] -- original table - 1, person1 - 2, person2 - 3, person3
Composite [ composite ID, individual Event ID ] -- defines which Event(s) belong to a particular CompositeEvent - 3, 1 - 3, 2
Composite Info [ ID, location ] -- additional CompositeEvent info - 3, park
Therefore, adding Event 3 (which is a CompositeEvent) should automatically populate the 2 other tables with the appropriate information. The reason I'm having a problem here is that I cannot edit/change Event, neither the class nor the Hibernate mapping file... and I'm having a difficult time figuring out how to do the composite and subclass mapping without changing the Event mapping.
I've simplified the example in hopes that someone can point me to the obvious solution that I just don't see :)
TIA
|