Hi,

 

I didn't solve my problem yet.

Was the question unclear?

 

Thank you very much.

 

  _____  

From: Samuel Coutu 
Sent: Thursday, August 09, 2007 4:01 PM
To: [email protected]
Subject: Lazy Loading 1:1 Null

 

Hi,

 

I load a User object from IBatis.

IBatis lazy loads the BillingAddress object property from this User.

 

When I directly use the properties of BillingAddress after IBatis gave
it to me, there is no problem.

But, if instead of directly using the properties, I pass
User.BillingAddress as a parameter to another method, this method
receives a Null BillingAddress object. 

 

Ex:

 

When BilingAddress is not null

---------

void Method1()

{

            User user = userDAO.GetUser();

            Println(user.BillingAddress.Street);

            // Here Billing address is not null

}

 

 

When BilingAddress is null

---------

void Method1()

{

            User user = userDAO.GetUser();

            PrintStreet(user.BillingAddress);

}

 

void PrintStreet(BillingAddress addr)

{

            Println(addr.Street);

            // Here 'addr' is null

}

 

Maybe we pass the reference of an object that is not wrapped by IBatis.

 

Thanks for your help.

 

 

Reply via email to