This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Most of the time I want my stuff to be lazyload, but from time to time (say with a listing looping action) it would be most efficient if there was someway I could have a Pre-Fetch of all children Items for an object, or for a collection of objects. Say I have a list of Family objects, each of which has a Parents Collection and a children collection and a pets collection. Most of the time I would work with one family at a time and only load one of the collections, but for a big report printout, as I loop thru each family and grab each of the collections, I hit the database in seperate calls. DB calls are expensive (usually). It would be better if I could somehow say |
|
|
We provide this through a feature called "named aggregates." Essentially rather than saying "prefetchChildCollections = true" you specify which collections (or other associations) you want to be part of a given "load pattern" (named aggregate), and in any given query you can specify which "load pattern" you want to use. Thus you might create a "WithAllChildren" named aggregate and include all of Family's associations in that aggregate. - See Help Topics > LightSpeed > Querying - Basic Features in the help file for an overview, for how to set up a named aggregate in code and for how to specify a particular aggregate when querying using the core API. - See Help Topics > LINQ > Using LightSpeed Features from LINQ for how to specify a named aggregate when querying using LINQ. - In the designer, use the Collection Aggregates and Backreference Aggregates properties of the association to set up named aggregates in the respective directions. See Help Topics > Modelling Tools > Creating Models with the Designer for additional info. |
|