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