This project is read-only.

Depth when load objects

Jan 20, 2010 at 10:41 AM


Is possible with Opf3 to determine a specify depth to load a object using GetObject or GetPersistents or anohter way?



Jan 20, 2010 at 4:38 PM

To my knowledge the only thing I can think of is to set the AutomaticallyLoadRelatedObjects property to false on the object context. I don't think there's anyway to specify a load depth. You would have to load the relations manually at this point. littleguru may have an alternative method that I don't know about but I've never had a situation where I didn't need all relations loaded. If it's a question of performance, you could create a new class to act as a "view", set the PersistentRights to allow only loading, and then add or remove the relations you need.

Personally, I create new classes all the time to hold information returned from stored procedures, and with the use of an objectset I bind it to all sorts of controls.


Jan 22, 2010 at 3:31 AM

Correct. You can only do it manually or Opf3 will load the related objects independent of the depth. But keep in mind it is lazy loading. Objects are only loaded when you traverse the graph.