Chili.Opf3 Send comments on this topic.
ObjectStates Enumeration
See Also   Example
Chili.Opf3 Namespace : ObjectStates Enumeration




Defines the state of a persistent object in memory.

Syntax

Visual Basic (Declaration) 
Public Enum ObjectStates 
   Inherits Enum
Visual Basic (Usage)Copy Code
Dim instance As ObjectStates
C# 
public enum ObjectStates : Enum 
Managed Extensions for C++ 
__value public enum ObjectStates : public Enum 
C++/CLI 
public enum class ObjectStates : public Enum 

Members

MemberDescription
None Persistent objects with this state aren't loaded, saved or deleted. They have been recently created in memory.
Loaded Persistent objects with this state have been loaded from the storage.
Inserted Persistent objects with this state have been inserted into the storage. The framework is doing an update if the persistent is saved again.
Updated Persistent objects with this state have been updated in the storage.
Deleted Persistent objects with this state are no longer available in the storage. They have been deleted. The framework is doing an insert if they are saved the next time.

Example

The following example shows how to request the ObjectInfo instance of the ISelfContainingObject to determine whether the object has been loaded from the storage.
C#Copy Code
            [Persistent("USER")] 
public class User : ISelfContainingObject 

    // ... Other properties and fields. 

  
// ... Other code 
  
// Loads a user object from the storage. 
User user = context.GetObject<User>("Id = {0}", "1"); 
// Checks if the object has been loaded. 
if (user.ObjectInfo.ObjectState == ObjectStates.Loaded) 

    Debug.WriteLine("Object has been loaded."); 

    

Remarks

This enumeration represents the state of a persistent object. It is used internally to decide whether to insert, update or delete an object to/from the storage.

Attention: Modifying properties using this enumeration could cause unexpected behavior when saving objects.

Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         Chili.Opf3.ObjectStates

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