Telerik OpenAccess Classic

Telerik OpenAccess ORM Send comments on this topic.
Default FetchGroup
See Also
Programmer's Guide > OpenAccess ORM Classic (Old API) > Programming With OpenAccess > FetchPlans and FetchGroups > Default FetchGroup

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.

A default FetchGroup is created for each class, and it will retrieve all the fields that are of basic type or single reference type (only the id of the referenced object will be retrieved), as a result of a query or while resolving a reference. The default FetchGroup will not retrieve any collections, hashtables or blobs.

In case of reference type fields, only the id of the referenced object is fetched from the database. The referenced object itself will only be fetched when it is actually accessed. When a referencing object is used as a parameter in the Retrieve method, the Retrieve method could fail, if the referenced sub-object is not accessible.

So, the default FetchGroup is the set of fields that are retrieved, if any field of the object is accessed the very first time. Fields that are not part of the default FetchGroup; will be loaded on demand, when they are accessed for the first time.

It is possible to include or exclude fields from a default FetchGroup, and thereby control the fields retrieved, by using the DefaultFetchGroup attribute. Refer to DefaultFetchGroup Attribute for more information.

For example, a string field that contains a typically large document can be marked with the DefaultFetchGroup attribute set to false, and so it will not be part of the default FetchGroup, and the field will be loaded only when accessed by the application. This can be done as under:

C# Copy Code
[DefaultFetchGroup( false )]
private string name;
VB .NET Copy Code
<DefaultFetchGroup(False)> _
Private name As String

See Also