I noticed in log file the following SQL for my
SalesInvoiceLine.Movements collection of SalesMovement objects

NHibernate.Persister.Collection.AbstractCollectionPersister.LogStaticSQL(c:
\DotNet\NHibernate\NHibernateSource\nhibernate\src\NHibernate\Persister
\Collection\AbstractCollectionPersister.cs:572) -  One-shot delete:
UPDATE Movement SET DocLineId = null WHERE DocLineId = ?

This could reset more records than I was expecting as it does not
check the discriminator column, and the DocLineId holds Id's from
different tables.

Have I missed an option or do I need nHibernate fixed or am I heading
down a path of pain with my design ? Needless to say I am stuck with
legacy database and can only make limited alterations.

The product movement table holds PurchaseMovement and SalesMovement
records which link to Purchase Invoice lines and Sales Invoice lines,
stored in PInvLine and SInvLine tables. The DocLineId is the
InvoiceLineId from the applicable table so that SQL statement would
clear both if the same ID happened to exist in both PInvLine and
SinvLine table. The SalesInvoiceLine uses the following mapping:-

HasMany<SalesMovement>(x =>
x.Movements).KeyColumn("DocLineId").Table("Movement").Cascade.SaveUpdate().AsSet();

Thanks

Matt

-- 
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