Chili.Opf3 Send comments on this topic.
PersistentAttribute Class
See Also  Members   Example 
Chili.Opf3 Namespace : PersistentAttribute Class




Marks a class as a persistent object.

Syntax

Visual Basic (Declaration) 
Public NotInheritable Class PersistentAttribute 
   Inherits Attribute
Visual Basic (Usage)Copy Code
Dim instance As PersistentAttribute
C# 
public sealed class PersistentAttribute : Attribute 
Managed Extensions for C++ 
public __gc __sealed class PersistentAttribute : public Attribute 
C++/CLI 
public ref class PersistentAttribute sealed : public Attribute 

Example

The following example shows a User persistent associated with the "USER" entity in the storage. The pool size set to 100 objects to gain speed on heavy loads. The FieldAttribute is used to connect a property with a field of the entity.
C#Copy Code
            [Persistent("USER", PoolSize = 100)] 
public class User 

    private string _name = null; 
     
    [Field("NAME")] 
    public string Name 
    { 
        get { return _name; } 
        set { _name = value; } 
    } 
     
    // ... Other properties and fields. 

    

Remarks

This attribute is used to mark a class as persistent. As constructor argument has to be specified the name of the entity in the storage. The attribute allows also to specify the size of the pre-cached persistent object pool by modifying the PoolSize property (default is 0, which means no pool is created). The pool is a cache that contains empty objects that are used during heavy loads.

Inheritance Hierarchy

System.Object
   System.Attribute
      Chili.Opf3.PersistentAttribute

Requirements

Namespace: Chili.Opf3

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