-->
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: Multiple parent/child classes per table
PostPosted: Thu Mar 13, 2008 1:34 pm 
Newbie

Joined: Thu Mar 13, 2008 8:42 am
Posts: 1
I'm working on evaluating the nhibernate against our legacy database and I ran into an issue where one table has 3 entities represent in it. I wondering if it is possible to model this type of storage.

For example consider the following

Table layout

RowID, Organization ID, Year ID, Line of Business, Unit, Department
1, 1234, 2, Services, Sales, Direct
1, 1234, 2, Services, Sales, Dealer
1, 1234, 2, Services, Consulting, SMB
1, 1234, 2, Services, Consulting, Enterprise
1, 1234, 2, Corp, Finical , AP

The entities and relationship would be

Organization (1) -> (1...*) Line of Business -> Unit (1...*) -> Department (1...*)

I'm thinking that I should create a new object and components for Line of Business, Unit, and department but I'm unsure how to the mapping to tell nhibernate to build the collections or the tree structure.

Any thoughts?


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.