Telerik OpenAccess Classic

Telerik OpenAccess ORM Send comments on this topic.
DefaultFetchGroup Attribute
Programmer's Guide > OpenAccess ORM Classic (Old API) > Programming With OpenAccess > Attributes > Field Attributes > DefaultFetchGroup Attribute

Glossary Item Box

This documentation article is a legacy resource describing the functionality of the deprecated OpenAccess Classic only. The contemporary documentation of Telerik OpenAccess ORM is available here.

The field attribute [DefaultFetchGroup] specifies whether the field is part of the default fetch group. It defaults to true for non-key fields of simple types and to false for other fields. Simple types are the .NET numeric value types such as int, double, etc., and string, bool, char, System.Decimal, and System.DateTime.

Fetch groups represent a grouping of fields that are retrieved from the datastore together. Typically, a datastore associates a number of data values together and efficiently retrieves these values. Other values require extra method calls to retrieve. By default, the default fetch group is used when an object is initially retrieved from the database, for example, as a result of a query or when resolving a reference. All fields of the default fetch group are loaded, fields not in the default fetch group will be loaded on demand when they are accessed for the first time.

You might exclude fields from the default fetch group, if you know that they are used very rarely by the application. You might add additional fields to the default fetch group, if you know that your application will always need access to the field. For example, consider a class with a field of type IList, named lines, for storing the line items for the order as instances of type OrderLine. By default, the lines field is not in the default fetch group. However, if your application always accesses the lines list, it might improve the overall performance if you include the lines field in the default fetch group.

Copy Code
[DefaultFetchGroup( true )]
IList lines;