As far as I know (James told me so a long time ago) subclassing a subclass is yet to be supported. He even doubted that it was possible in NHibernate. Tell me if you find a way because I have a need for this as well :)
2009/10/27 [email protected] <[email protected]> > > Just wanted to add that I am not using the latest version of Fluent > Nhibernate. I downloaded the source code from teh repository on Aug > 28th. > > > > On Oct 27, 12:06 am, "[email protected]" <[email protected]> > wrote: > > Hi, > > > > I have the following class structure. > > public class Request > > { > > public int Id {get;set;} > > public string prop1 {get;set;} > > > > } > > > > public class RequestA:Request > > { > > public string propA1 {get;set;} > > public string propA2{get;set;} > > > > } > > > > public class RequestB: Request > > { > > public string propB1 {get;set;} > > public string propB2{get;set;}} > > > > public class RequestBB: RequestB > > { > > public string propBB1 {get;set;} > > > > } > > > > and the following Mapping . > > public class RequestMap:ClassMap<Request> > > { > > public RequestMap() > > { > > Table("Requests"); > > Id(....); > > Map(...); > > > > JoinedSubClass<RequestA>("RequestID", MapRequestA); > > JoinedSubClass<RequestB>("RequestID", MapRequestB); > > } > > > > public void MapRequestA(JoinedSubClassPart<RequestA> part) > > { > > Table("RequestsA"); > > Map(...); > > Map(...); > > } > > > > public void MapRequestB(JoinedSubClassPart<RequestB> part) > > { > > Table("RequestsB"); > > Map(...); > > Map(...); > > JoinedSubClass<RequestBB>("RequestID", MapRequestBB); > > } > > > > public void MapRequestBB(JoinedSubClassPart<RequestBB> part) > > { > > Table("RequestsBB"); > > Map(...); > > } > > > > } > > > > I dont have any issues with saving RequestA. But when I create and > > save RequestBB, nothing gets populated in the RequestsB table. In > > fact, I looked at the insert and the select statements, the RequestsB > > table does not get called at all. > > > > When I do a select to fetch all RequestBB items, the query does an > > inner join between the Requests table and the RequestsBB table and > > completely ignores the RequestsB table. > > > > When I do a select to fetch all RequestB items, then the query does an > > join between the Requests table and the RequestsB table. > > > > I am not sure what I am doing wrong > > > > thanks > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---
