T
Chili.Opf3 Send comments on this topic.
Generic ObjectSetHolder Class
See Also  Members   Example 
Chili.Opf3.Relations Namespace : Generic ObjectSetHolder Class




Holds an ObjectSet of objects that are connected with the parent object.

Object Model





Syntax

Visual Basic (Declaration) 
Public NotInheritable Class ObjectSetHolder(Of T) 
   Inherits ObjectHolderBase
Visual Basic (Usage)Copy Code
Dim instance As ObjectSetHolder(Of T)
C# 
public sealed class ObjectSetHolder<T> : ObjectHolderBase 
Managed Extensions for C++ 
public __gc __sealed class ObjectSetHolder<T> : public ObjectHolderBase 
C++/CLI 
generic<typename T>
public ref class ObjectSetHolder sealed : public ObjectHolderBase 

Type Parameters

T

Example

The following example shows how to use the ObjectSetHolder in your persistent objects. In the example each User has associated Calls.
C#Copy Code
            [Persistent("USER", PoolSize = 50)] 
public class User 

    // The class contains an ObjectSetHolder and a RelationAttribute 
    // that specifies the relation between the parent object and the  
    // related objects. It demonstrates also how to use a condition to  
    // delimit the items in the list and to sort the result. 
    [Relation("Id", "UserId")] 
    private ObjectSetHolder<Call> _calls =  
        new ObjectSetHolder<Call>("Duration < {0} SortBy Duration Asc", "50"); 
 
    public ObjectSet<Call> Calls 
    { 
        get { return _calls.InnerObject; } 
        set { _calls.InnerObject = value; } 
    } 
     
    // ... Other properties and code. 
}

Remarks

This class is used in a persistent class to hold an ObjectSet of objects that are connected with the parent object. When accessing the first time the InnerObject property the related objects are loaded. This is called delayed loading and reduces roundtrips to the storage.

Inheritance Hierarchy

System.Object
   Chili.Opf3.Relations.ObjectHolderBase
      Chili.Opf3.Relations.ObjectSetHolder

Requirements

Namespace: Chili.Opf3.Relations

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Chili.Opf3 (in Chili.Opf3.dll)

See Also