Hi,
New to NHibernate... so probably an easy one, but could not find it in the doc...
I have a persisted class that look-up one of it's value in another table. That looked-up table is also set-up as a class in NHibernate. On my form, I use a ComboBox, loaded with all the possible looked-up values so the user just pick the right one.
When I run this thing, it does not appear that the looked-up object (from the main class) does not equal to any one from the looked-up collection (even if it's value is there in the collection)... Obviously, it mean that the comparison is done on the object adress (or what-ever) and that there is two of the same value in memory.
I thougt that NHibernate would not create multiple copy of the same object, that once it was fetched from the DB (when I load it frist from my main class) it would actually not have to do much when I go fetch all the looked-up values to put it in the ComboBox, that it would just have to get the one that have not been fetched so far based, say, on the PK value...
Most probably I did not set-up something properly. I would appreciate a pointer to where I could get the proper information on how I could do this.
Many thank's in advance.
|