-->
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: idbag with many-to-many
PostPosted: Tue Mar 24, 2009 5:30 am 
Newbie

Joined: Tue Mar 24, 2009 5:22 am
Posts: 1
Hi,

I'm a little new to NHibernate, so bear with me... this is my mapping file:

Code:
<class name="Log" table="Log" lazy="false">
.
.
.
<idbag name="Exceptions" table="LogException" cascade="none" lazy="false" where="IsDeleted=0">
         <collection-id column="LogExceptionID" type="Int32">
            <generator class="native"/>
         </collection-id>
         <key column="LogID" />
         <many-to-many class="Exception" column="OvenExceptionID" />
      </idbag>
.
.
.
</class>


So I'm basically storing logs, which can have one or more exceptions associated to them - these linked via the LogException link table.

So I have three tables right now: Log, Exception and LogException. Log and Exception are mapped to classes.

Now - I have to add start and end dates to each LogException record. Do I have to create a seperate class/mapping file for the link table or is there a better way of doing this?

I've got an exceptions table, which is mapped to a class - this holds the reference data. I've got a log table, which holds other information. Then


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.