This question is locked. New answers and comments are not allowed.
Hi,
i've got a question regarding the way openaccess handles lazy loading:
Lets say i've got the following entities:
and the following method:
I'd like to write out the currently available properties (including the navigation properties, if loaded) of the customer entity without triggering any lazy-load calls.
But when the method gets called, i know nothing about the customer's origin.
Hence i don't know if the Property "RentalOrders" has been included via a fetchstrategy/include or not.
Is there a way to detect if navigation property X for entity Y on instance Z has been loaded or not ?
So far what i've come up with, doesn't really get me where i want to be:
The snippet above avoids any Lazy-Load call, but i loose any previously loaded navigation property.
Thanks in advance.
Kind regards,
Thorsten Klingert
i've got a question regarding the way openaccess handles lazy loading:
Lets say i've got the following entities:
public class Customer{ string Name {get; set;} IList<RentalOrders> RentalOrders {get;set;}}public class RentalOrder{...}and the following method:
public void WriteCustomer( Customer customer ){ ...}I'd like to write out the currently available properties (including the navigation properties, if loaded) of the customer entity without triggering any lazy-load calls.
But when the method gets called, i know nothing about the customer's origin.
Hence i don't know if the Property "RentalOrders" has been included via a fetchstrategy/include or not.
Is there a way to detect if navigation property X for entity Y on instance Z has been loaded or not ?
So far what i've come up with, doesn't really get me where i want to be:
var mgr = customer.OpenAccessEnhancedGetPersistenceManager();if (mgr != null){ var scope = mgr.getUserObject() as IExtendedObjectScope; if (scope != null) { var omg = new ArrayList(1); omg.Add(customer); scope.CreateDetachedCopies( omg, null ); customer= omg[0]; }}Thanks in advance.
Kind regards,
Thorsten Klingert