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.  [ 6 posts ] 
Author Message
 Post subject: Inheritance question
PostPosted: Wed Oct 26, 2005 5:04 am 
Beginner
Beginner

Joined: Tue Oct 25, 2005 2:44 am
Posts: 20
Location: Sydney, Australia
I have a scenario I'm not sure how to handle in the mapping. I have the following structure:

abstract class baseClass{...}

class Persistable1 : baseClass{...} (has typeValue=1)

abstract class subBaseClass : baseClass {...}
(properties map to a second table, as in joined-subclass)

class Persistable2 : subBaseClass{...} (has typeValue=2)
class Persistable3 : subBaseClass{...} (has typeValue=3)

I see from the documentation that joined-subclasses and subclasses can't mix and match, however Persistable1 class doesn't have any additional properties so can't be a joined-subclass.

How can I represent this in the mapping file?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 6:16 am 
Senior
Senior

Joined: Thu Jun 02, 2005 5:03 pm
Posts: 135
Location: Paris
While it's true that you can't mix subclass and joined-subclass for decendents of a single base class (you have to choose one or the other) it actually is possible to have joined-subclasses that don't have any additional properties. I've actually done exactly that.

That irritating part is that you have to have a separate table for every joined-subclass, so for empty ones the table must exist with nothing but an Id in it, but it's a good start in the event that you're expecting to expand the class's properties in the future.

Cheers,

Symon.[/i]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2005 9:00 am 
Beginner
Beginner

Joined: Tue May 17, 2005 11:42 am
Posts: 22
To the NHibernate Team, which are the possibilities of seeing such feature implemented in future versions.
I think this is a really needed feature.
Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2005 11:41 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
What you can do is:
- Create a JIRA issue for that: http://jira.nhibernate.org/
- Post its link here
- Vote for it :)

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2005 2:03 pm 
Beginner
Beginner

Joined: Tue May 17, 2005 11:42 am
Posts: 22
JIRA ISSUE
http://jira.nhibernate.org/browse/NH-424
Please VOTE!!! :D


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 15, 2007 11:29 am 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
See new comments on http://jira.nhibernate.org/browse/NH-424

_________________
Karl Chu


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