-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Persiting Proxied Objects
PostPosted: Wed Feb 24, 2010 4:59 pm 
Newbie

Joined: Mon May 04, 2009 5:47 pm
Posts: 2
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.