-->
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: Parent , Child and GrandChild mapping in Fluent Nhibernate
PostPosted: Tue Oct 01, 2013 8:37 am 
Newbie

Joined: Tue Oct 01, 2013 6:35 am
Posts: 1
Hi ,

how to map Parent -> Child -> Grandchild mapping using Fluent NHibernate - TablePerSubclass approach. Please find below details as follows.

Table tblA1: [columns : Id(PK : Identity Column), Description, Name ] // one to many relationship with tblB

Table tblA2: [columns : Id(PK : Identity Column), Comments, Instructions] // one to many relationship with tblB

//ManytoOne relationship with tblA1 and tblA2
//OnetoOne relationship with tblC
Table tblB: [Columns : Id (Identity and PK) , tblA1Id(Foreignkey of Id in tblA1),tblA2Id(Foreignkey of Id in tblA2),col3Id(FK - MasterData), col4Id(FK -MasterData)

//OnetoOne relationship with tblB
Table tblC [Columns: Id(FK of TBlB) , Value]

I am able to save the data in tblB and tblc using TablePersubclass apporach.

How to map the tblA1 and tblA2 with tblB using fluent nhibernate ?
Can we acheive this using TablePerSubclass approach ?

tblA1 and tblA2 entities are not mandatory, Only for exceptional cases, we need to add data in tblA1 or in tblA2 tables. so, By default we are setting the value as 0 for normal scenarios.

Please help me out how to acheive this using fluent Nhibernate

Thanks in Advance,
bskumar645


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.