-->
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.  [ 1 post ] 
Author Message
 Post subject: ways to map a subclass within a subclass
PostPosted: Tue Sep 21, 2004 11:27 am 
Newbie

Joined: Tue Sep 21, 2004 10:46 am
Posts: 2
I have a general question and a specific one:

The general question is: I'm working with a class hierarchy: ClassA<--ClassB<--ClassC, for example, it can be a Person<--Employee<--Manager hierarchy. I wonder what is the best practice for mapping such a class hierarchy using Hibernate.

The specific question is: I've tried to map the class hierarchy using the table-per-class-hierarchy strategy, but I'd want to use a different discriminator for the ClassA<--ClassB branch than that for the ClassB<--ClassC branch. For Hibernate-2.1, it does not allow to specify a discriminator in the mapping of ClassB (such that the mapping of ClassC and its sibling classes can have a discriminator-value attribute): I got exception for doing this with the complain that the discriminator element need to be defined for the subclass element. I understand that Hibernate-3 offers more in o-r mapping options, so I downlowed Hibernate-3 from cvs and built it, then I removed the hibernate2.jar, replacing it with hibernate3.jar. Generating Java code and compile them were fine. But when I tried to generate the database schema, I got:
java.lang.NoClassDefFoundError: net/sf/hibernate/MappingException
at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)

Can someones shine some lights on the subject? Thanks in advance.


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

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.