The <bag> should have inverse="true" on it, most probably

On Fri, Oct 3, 2008 at 10:52 PM, marshal simmons
<[EMAIL PROTECTED]>wrote:

>
> I am using <join> to map multiple tables to a single entity
> (
> http://ayende.com/Blog/archive/2007/04/24/Multi-Table-Entities-in-NHibernate.aspx
> ).
>  When I try to update a many-to-one within my join it is trying to
> update the table defined at the class level instead of at the join
> level.  Here is a piece of my mapping:
>
> Invoice Mapping:
> <class name="Model.Invoice, Core" table="invoice">
>        <id name="Key" column="inv_key" type="Guid"
> unsaved-value="00000000-0000-0000-0000-000000000000">
>                <generator class="guid" />
>        </id>
>        ...properties
>    <join table="invoice_ext" inverse="true">
>      <key column="inv_key_ext" />
>      <many-to-one name="Application" class="Model.Application, Core"
> column="inv_m01_key_ext" />
>    </join>
>
> Application mapping (bag to invoice):
>   <bag name="Invoices" lazy="true" table="invoice_ext">
>            <key column="inv_m01_key_ext" />
>            <one-to-many class="Model.Invoice, Core" />
>    </bag>
>
> When I update the column being updated is correct but the table and
> key are from the class definition (invoice) instead of the join
> (invoice_ext).  Any ideas what I'm doing wrong?  Is it invalid to
> define a many-to-one within a join?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to