-->
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.  [ 3 posts ] 
Author Message
 Post subject: subclass or joined subclass or...
PostPosted: Fri Aug 27, 2004 10:26 am 
Newbie

Joined: Thu Jul 15, 2004 1:07 pm
Posts: 9
Hibernate version:
2.1

Name and version of the database you are using:
mysql 4.0.16

I have been using Tom Sedge's excellent documentation on Index of Relationships and have been having great success.

But now I stumble onto something I need a little guidance on. It seems to fall somewhere in the realm of subclass or joined subclass.

I have a baseclass (table) Activity and subclasses Biking and Surfing, for example. Activity has a primary key, a name, a and a location. The subclasses extend this information with database tables pertaining to their own activity types and would be keyed off the activity table's primary key.

The subclass mapping implies that each row of data can be mapped to a different sublcass based on a discriminator-value (if I'm reading it right). Which is a concept that I think I need to use as each activity row is potentially instantiated as a different activity object (Biking, Surfing, ...). But subclass doesn't join tables.

The joined subclass mapping doesn't seem to support each join being a potentially different subclass, but instead is always the same subclass.

Is there another way I should be approaching this or am I possibly misinterpreting subclass and joined subclass?

Thanks,
Jay Wright


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 27, 2004 10:31 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
you don't need a discriminator column for table per sublass strat

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 30, 2004 1:22 pm 
Newbie

Joined: Thu Jul 15, 2004 1:07 pm
Posts: 9
ah - my bad. i made an incorrect assumption based on the example i was looking at.

it works fine now.

-thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.