NHibernate And Many-To-One Mapping

S

sternr

Hey,
I'm using NHibernate version: 1.0.0.2

My Mapping documents:

<class name="DM.Book" table="Books">
<id column="bookId" name="bookId">
<generator class="assigned" />
</id>
<property column="name" name="name" />
<many-to-one name="Author" class="DM.Author" column="authorId"
fetch="join" outer-join="true" not-null="false" />
</class>

Even though I configured the many-to-one to use outer-join,
When I try to - session.Load a book with an author that I deleted,
I get the following error:
ObjectNotFoundException - No Row With The Given Idetifier Exists...

Am I configuring the outer-join incorrectly?

Thanks ahead

sternr
 
W

Willem van Rumpt

sternr said:
Hey,
I'm using NHibernate version: 1.0.0.2

First of all, you might have better luck asking this question in the
NHibernate forums:

http://forum.hibernate.org/viewforum.php?f=25&sid=02ea72465a87f42117d919f96bd0e389

or

http://tinyurl.com/p7tft
My Mapping documents:

<class name="DM.Book" table="Books">
<id column="bookId" name="bookId">
<generator class="assigned" />
</id>
<property column="name" name="name" />
<many-to-one name="Author" class="DM.Author" column="authorId"
fetch="join" outer-join="true" not-null="false" />
</class>

The mapping itself looks ok as far as I can see, though I recommend
using fully qualified assembly names in the mapping. Does the id of the
book itself exist?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top