Can Sterling lazy load child objects?

May 27, 2011 at 5:58 PM

Hello! I'm using version 1.4 (beta) on Windows Phone, and have a question related to nested objects. If I have say, a Person object, with a nested "Address" object, and both objects are defined in the database (ie. both have a corresponding table), how does Sterling load the child object?

If I do a standard query by Person key, I get a Person LazyValue - next, if I access LazyValue.Value, I get a Person object, and my very preliminary test shows that the child "Address" object is being fully loaded as well. I may be asking for too much, but is there a way to make the child be "lazily" loaded? 

I guess I could put a SterlingIgnore attribute on the child property, and save the child independently (and in the getter of the child property, I could perform the lazy load)....but wondering if there's a better way to do this.

 

Thanks for your time,

Priya

Coordinator
May 29, 2011 at 4:04 PM

Currently, Sterling does not support lazy loading objects. I agree this is a powerful feature and expected among first class ORMs and will be on the feature list for the future.

Jun 2, 2011 at 2:11 PM
Edited Jun 2, 2011 at 2:15 PM

Great, thanks so much for your help!