InvalidCastException from FindDirty on many-to-one association with property-ref to composite-id class

Description

When one class (A) references another (B) using a composite-id, through a many-to-one association with a property-ref, all operations appear to work normally except for the update – which fails on the call to FlushDirty on A with a new reference to a B (either new or existing B). It seems as if the flush dirty ignores the property-ref association and attempts to ascertain whether the property is dirty by comparing the property-ref's actual value (which is an integer) to the new B's composite identifier.

I will attach a test ASAP.

Error:

NHibernate.Test.NHSpecificTest.NH1234.BugTestCase.PropertyRefCompositeIdDoesNotFlushProperlyOnUpdate:
System.InvalidCastException : Unable to cast object of type 'System.Int32' to type 'NHibernate.Test.NHSpecificTest.NH1234.WidgetCategory'.

See:

http://groups.google.com/group/nhusers/browse_thread/thread/36085e43e5a65698/fd7a90465de1f1e3?lnk=gst&q=finddirty#fd7a90465de1f1e3

Tested with SQLite ADO.Net provider (found on ms sql 2005)

Environment

None

Attachments

1

Activity

Show:
Not an Issue

Details

Assignee

Reporter

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created December 26, 2008 at 11:46 AM
Updated April 22, 2013 at 4:02 PM
Resolved June 5, 2009 at 12:02 PM
Who's Looking?