I checked Equals, and there was a error in there indeed. I changed it and now it is working!!!
Thanks a million. On Jan 15, 3:18 pm, Roger Kratz <[email protected]> wrote: > I would verify that IuserType.Equals(object, object) is correctly impl. Set a > break point there when you flush your session. > > -----Original Message----- > From: [email protected] [mailto:[email protected]] On Behalf Of > Adeel > Sent: den 15 januari 2009 15:06 > To: nhusers > Subject: [nhusers] Re: IsDirty() is true when retrieving objects > > Forgotten... > > On 15 jan, 14:59, Roger Kratz <[email protected]> wrote: > > Ah, sorry - didn't see you had your own IUSertype. Forget my mail. > > > -----Original Message----- > > From: [email protected] [mailto:[email protected]] On Behalf > > Of Adeel > > Sent: den 15 januari 2009 14:56 > > To: nhusers > > Subject: [nhusers] IsDirty() is true when retrieving objects > > > Hibernate version: > > Nhibernate 2.1.0.1001 > > > Mapping documents: > > > <property name="hairColorCollectie" > > type="HiDating.BusinessLayer.Mapping.EnumMappingHelper`1 > > [[HiDating.BusinessLayer.HairColor, HiDating.BusinessLayer]], > > HiDating.BusinessLayer" access="field" > > column="PersonProfile_HairColorID" /> > > > Code between sessionFactory.openSession() and session.close(): > > > [Test] > > public void CanClearProvincesInSearchProfile() > > { > > ISessionFactory _sessionFactory = new Configuration().Configure > > ().BuildSessionFactory(); > > > _iSession = _sessionFactory.OpenSession(); > > > SearchProfile profile = (SearchProfile)_iSession.Get(typeof > > (SearchProfile), 47); > > > Assert.IsFalse(_iSession.IsDirty()); > > } > > > For my Current project I have to work with a legacy database. > > In this database, collections have been mapped to single columns in > > the database. To map this to collections in .net, I have made use of > > IUserType and ICompositeUserType. > > > The issue now is that the Session.IsDirty() returns true when I > > retrieve the containing object. > > > I can't figure out what is causing the session to become dirty, I am > > making sure, for instance, that I use the type of the enum in the > > mapping instead of an int32. Can somebody help me please!!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
