Ran into an issue with a lazy loaded / proxied object being persisted today.
It relates to two classes, Invoice and Address. A invoice has an Address property. Both classes are setup to be lazy loaded and all methods are virtual.
In the code I do a Invoice.address = HomeCompany.address and I can verify at runtime that the Invoice.address is being set correctly (The Invoice.address property is correctly assigned an 'address proxy'). However when the Invoice object gets persisted, the 'addresss_id' columns in the invoice table is being set to '0'. If however, i change the mapping file for the address by adding 'Lazy = False' everything works just fine (the invoice.address property is set to a full instantiated address).
Using nHibernate 2.1.2 and this is driving me crazy.
|