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.  [ 2 posts ] 
Author Message
 Post subject: Model Inheritance w/ 1:M
PostPosted: Mon Jun 18, 2007 1:30 pm 
Newbie

Joined: Mon Jun 18, 2007 1:14 pm
Posts: 1
Hello,

I a master table JournalEntries:

JournalEntryID Int, PK, Identity
EntryDate SmallDateTime
EntryText VarChar(MAX)
RowVersion Int

Then for each table I want to have jounral entries, I have another table, ie:

PersonJournalEntries
JournalEntryID Int, PK, FK to JournalEntryID in JournalEntries
PersonID Int, FK to People table

AccountJournalEntries
JournalEntryID Int, PK, FK to JournalEntryID in JournalEntries
AccountID Int, FK to Accounts table

What is the best way to model this in v1.2 of NH mapping file?

Thanks a million!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 18, 2007 2:19 pm 
Expert
Expert

Joined: Fri May 13, 2005 11:13 am
Posts: 292
Location: Rochester, NY
Use the table-per-subclass strategy. See section 8.1 of the docs.


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