-->
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.  [ 5 posts ] 
Author Message
 Post subject: hibernate inheritance mapping
PostPosted: Mon Jun 14, 2004 3:19 pm 
Beginner
Beginner

Joined: Thu Oct 23, 2003 1:17 pm
Posts: 44
I'm pretty new at Hibernate, and I was comparing it to JDO. One of the things I liked about JDO compared to Hibernate was that in the mapping file, when you mapped the child, you specified the parent, rather than the Hibernate way of having to map all the subclasses in the same file as the parent. Any reason why Hibernate did the inheritance mapping this way?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 3:57 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Use <subclass extends="SuperClass"> in a new file with Hibernate. JDO doesn't define any mappings, by the way, you must have used a product that has proprietary object/relational mapping.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 9:51 pm 
Beginner
Beginner

Joined: Thu Oct 23, 2003 1:17 pm
Posts: 44
christian wrote:
Use <subclass extends="SuperClass"> in a new file with Hibernate.


Ahhh, from reading this doc:
http://www.hibernate.org/hib_docs/refer ... tance.html
I didn't realize that the <subclass> tag didn't have to be inside the parent <class> tag, but now looking at the hibernate dtd, I see that I can :)


christian wrote:
JDO doesn't define any mappings, by the way, you must have used a product that has proprietary object/relational mapping.


I don't understand what you mean when you asy that JDO doesn't define any mappings? Doesn't this dtd define (to a limited extent) how the mappings work?

http://java.sun.com/dtd/jdo_1_0.dtd

I realize that JDO leaves a lot up to whoever implements the JDO spec. But isn't the persistence-capable-superclass attribute of the class tag pretty much defined by Sun?

Thanks again for pointing out the subclass thing, I think it's much cleaner if it's in another file.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 10:13 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Quote:
http://java.sun.com/dtd/jdo_1_0.dtd


Thats not mapping metadata schema, but a simple object metadata schema that has no direct practical uses.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 15, 2004 7:41 am 
Beginner
Beginner

Joined: Thu Oct 23, 2003 1:17 pm
Posts: 44
Ah, I see what you mean. In my head, I was just looking at the metadata as a mapping, since that's what they use to figure out what fields get stored where.

Thanks again for the help.


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