-->
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.  [ 7 posts ] 
Author Message
 Post subject: Mapping A Base Class With Generics
PostPosted: Sun Feb 04, 2007 5:18 am 
Beginner
Beginner

Joined: Fri Sep 08, 2006 2:55 am
Posts: 21
I'm using NHibernate 1.2.0.1001 and have a mapping issue.

I have an abstract baseclass MyBase<TMyType> and subclasses replace the type parameter MyType.

I thus have MyDerived<AnotherClass> and MySecondDerived<YetAnotherClass>. AnotherClass and YetAnotherClass share an interface ISharedInterface.

I want to map this as a class with subclasses and I've tried a mapping like this:

<class name="Domain.MyBase'1[ISharedInterface], Domain" table="ThrTable" lazy="false" polymorphism="explicit">

This doesn't work and I've found nothing about whether what I'm doing is possible so I really wondered if anyone had any ideas.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 04, 2007 6:16 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
No, this is currently not supported, there are many places in NHibernate that do not handle generic types correctly (mostly in the HQL parser).


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 04, 2007 9:04 am 
Beginner
Beginner

Joined: Fri Sep 08, 2006 2:55 am
Posts: 21
Thanks for replying and answering my question, can I ask whether its something that is likely to be supported in the near future or is it quite far down the priority list?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 04, 2007 10:01 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
I haven't yet thought about what the future versions of NHibernate will or will not include, right now I am focused on finishing 1.2.0. Enter a JIRA issue about this and you will get informed eventually.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 04, 2007 10:24 am 
Beginner
Beginner

Joined: Fri Sep 08, 2006 2:55 am
Posts: 21
Will do thanks, and thanks for all your work on NHibernate.


Top
 Profile  
 
 Post subject: Any progress?
PostPosted: Mon Jul 07, 2008 8:04 pm 
Newbie

Joined: Mon Jul 07, 2008 8:03 pm
Posts: 1
Has this issue / shortcoming ever been resolved?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 08, 2008 2:42 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
I think you're looking for that issue:

http://jira.nhibernate.org/browse/NH-960

Seems to be only a partial solution for generic collections.

_________________
--Wolfgang


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