These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: trouble with composites + subclass
PostPosted: Mon Sep 27, 2010 6:56 pm 
Newbie

Joined: Mon Sep 27, 2010 6:36 pm
Posts: 3
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


Top
 Profile  
 
 Post subject: Re: trouble with composites + subclass
PostPosted: Tue Sep 28, 2010 8:44 pm 
Newbie

Joined: Mon Sep 27, 2010 6:36 pm
Posts: 3
I guess the short version of this would be to ask how I can implement composite design pattern if I cannot modify (but can extend) the original object.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.