Hi.
I've got an app that works just fine with NHibernate version 0.9.1.0. This morning I decided to try and upgrade to version 1.0.1. I downloaded the zip file from sourceforge, updated my references to point to the new bin directory and then rebuilt and tried to run the app.
When I do I get the following error:
NHibernate.MappingException: Repated column in mapping for class xxx.xxx.User should be mapped with insert="false" update="false": UserID
If I go back to the 0.9.1.0 binaries the app still runs fine. My mapping file is as follows (namespaces have been changed to protect the innocent):
Code:
<?xml version='1.0' encoding='utf-8' ?>
<hibernate-mapping xmlns='urn:nhibernate-mapping-2.0'>
<class name='xxx.xxx.User,xxx.xxx' table='Users'>
<id name='UserID' column='UserID' type='Int32' unsaved-value='0'>
<generator class='native' />
</id>
<property name='Username' column='Username' type='String' />
<property name='Password' column='Password' type='String' />
<property name='FirstName' column='FirstName' type='String' />
<property name='LastName' column='LastName' type='String' />
<many-to-one
name='UserType'
class='xxx.xxx.UserType,xxx.xxx'
column='UserID'
not-null='true' />
<set
name='UserEstablishments'
lazy='true'
inverse='true'
cascade='all-delete-orphan'>
<key
column='UserID' />
<one-to-many
class='xxx.xxx.UserEstablishment,xxx.xxx' />
</set>
</class>
</hibernate-mapping>
As you can see, the supposedly repeated column mapping is not repeatedly mapped nor is it a regular property; it's my identifier. As such I don't think I can set the insert or update properties to false as suggested by the error since I don't believe identifiers even support those properties.
Any ideas on what I'm doing wrong?
Thanks.