I am having a problem mapping a one-to-one association which seems to go against all of the documentation. Just wondering if this is a bug before I tear any more hair out.
Here is the exception I am getting:
Code:
Could not find a getter for property 'PublisherId' in class 'Sp.Entity.NHibernate.PublisherLimits'
Nowhere in the docs for 1-to-1 associations with a shared PK does it say that the foreign identifier must be explicitly mapped and have the associated property in the child class. If I do map it, I get all sorts of problems when saving/updating. My child class does contain a reference to the parent 'Publisher' entity
Here are the mappings:
Code:
<class name="Publisher" table="publisher">
<id name="PublisherId" type="string" unsaved-value="null">
<column name="publisher_id" />
<generator class="assigned" />
</id>
<one-to-one name="PublisherLimits" class="PublisherLimits" cascade="all-delete-orphan" lazy="false" />
...
</class>
Code:
<class name="PublisherLimits" table="publisher_limits">
<id name="PublisherId" column="publisher_id">
<generator class="foreign">
<param name="property">Publisher</param>
</generator>
</id>
<one-to-one name="Publisher" class="Publisher" constrained="true"/>
...
</class>