-->
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: Inheritance mapping & abstract classes (again)
PostPosted: Mon Jul 18, 2005 6:02 pm 
Beginner
Beginner

Joined: Mon Jun 20, 2005 3:14 pm
Posts: 33
Hi,

I really don't know how to implement this mapping (each concrete class in a distinct table):

public abstract class Documento
public abstract class DocumentoPrincipal extends Documento
public abstract class DocumentoAuxiliar extends Documento
public class DocumentoPrincipalPIE extends DocumentoPrincipal
public class DocumentoAuxiliarOIE extends DocumentoAuxiliar

The real problem is the mapping between Documento and DocumentoPrincipal and DocumentoAuxiliar (all abstract classes).

Actually I'm using two files: DocumentoPrincipal.hbm.xml and DocumentoAuxiliar.hbm.xml and using discriminator/discriminator-value tags, but I have to redeclare all fields declared in Documento.

How do I implement this? what have I to use?
Please help...

Thanks,

André


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 19, 2005 1:43 am 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
Chapter 3.6 of the Hibernate in Action book has a nice description about inheritance.

HTH
Ernst


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 19, 2005 7:19 am 
Beginner
Beginner

Joined: Mon Jun 20, 2005 3:14 pm
Posts: 33
Ernest,

I've already read it, but this specific case is not described...

Andre


Top
 Profile  
 
 Post subject: Re: Inheritance mapping & abstract classes (again)
PostPosted: Tue Jul 19, 2005 8:44 am 
Newbie

Joined: Tue Mar 08, 2005 4:54 pm
Posts: 9
Location: GHANA WEST-AFRICA
yeah there are about three ways to implement .you can have one table for all of them that is a table per hierachy or a table per sub class.so let me know which one you will like to use.

plsease you can send it to me @ pkkamos@yahoo.com


Top
 Profile  
 
 Post subject: Re: Inheritance mapping & abstract classes (again)
PostPosted: Tue Jul 19, 2005 8:44 am 
Newbie

Joined: Tue Mar 08, 2005 4:54 pm
Posts: 9
Location: GHANA WEST-AFRICA
yeah ad-roach there are about three ways to implement .you can have one table for all of them that is a table per hierachy or a table per sub class.so let me know which one you will like to use.

plsease you can send it to me @ pkkamos@yahoo.com


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.