Click or drag to resize
PersistentObject Class
Base class for persistent objects.
Inheritance Hierarchy
SystemObject
  ObujekutoruPersistentObject

Namespace: Obujekutoru
Assembly: obujekutoru (in obujekutoru.dll) Version: 1.0.0.19089 (1.0.0.*)
Syntax
public abstract class PersistentObject

The PersistentObject type exposes the following members.

Constructors
  NameDescription
Public methodPersistentObject
Initializes a new instance of the PersistentObject Connection class.
Top
Properties
  NameDescription
Public propertyCreated
Gets the date and time when the object was created.
Public propertyFlag
Gets or sets the flags for this object.
Public propertyIsDirty
Gets a value indicating whether the object is dirty.
Public propertyIsNew
Gets a value indicating whether the object is new.
Public propertyObjectId
Gets the unique object id.
Public propertyUpdated
Gets the date and time when the object was last updated.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Protected field_created
Field that stores the date and time when the object was created.
Protected field_flag
Flag field. Use it as you see fit.
Protected field_isDirty
Field that indicates whether the object is dirty.
Protected field_isNew
Field that indicates whether the object is new.
Protected field_objectId
The unique object id.
Protected field_updated
Field that stores the date and time when the object was updated.
Top
Examples
The PersistentObject class is the base class for all persistent object classes. See below the implementation of a class that can be used to persist data in the Obujekutoru object store. Notice that the derived class has to declare a default constructor.
using System;

namespace ObujekutoruExamples.PersistentObjectExample
{
    [PersistentObject("PersistentObjectF")]
    internal class PersistentObjectF : PersistentObject
    {

        [PersistentObjectField("persistentObjectName", true)]
        private String _persistentObjectName;

        [PersistentObjectField("booleanField", true)]
        private Boolean _booleanField;
        [PersistentObjectField("byteField", true)]
        private Byte _byteField;
        [PersistentObjectField("bytesField", true)]
        private Byte[] _bytesField;
        [PersistentObjectField("charField", true)]
        private Char _charField;
        [PersistentObjectField("charsField", true)]
        private Char[] _charsField;
        [PersistentObjectField("datetimeField", true)]
        private DateTime _datetimeField;
        [PersistentObjectField("decimalField", true)]
        private Decimal _decimalField;
        [PersistentObjectField("doubleField", true)]
        private Double _doubleField;
        [PersistentObjectField("int16Field", true)]
        private Int16 _int16Field;
        [PersistentObjectField("int32Field", true)]
        private Int32 _int32Field;
        [PersistentObjectField("int64Field", true)]
        private Int64 _int64Field;
        [PersistentObjectField("sbyteField", true)]
        private SByte _sbyteField;
        [PersistentObjectField("singleField", true)]
        private Single _singleField;
        [PersistentObjectField("stringField", true)]
        private String _stringField;
        [PersistentObjectField("uint16Field", true)]
        private UInt16 _uint16Field;
        [PersistentObjectField("uint32Field", true)]
        private UInt32 _uint32Field;
        [PersistentObjectField("uint64Field", true)]
        private UInt64 _uint64Field;

        public PersistentObjectF()
        { }
        public PersistentObjectF(String persistentObjectName)
        {
            _persistentObjectName = persistentObjectName;
        }

        public String PersistentObjectName
        {
            get { return _persistentObjectName; }
            set
            {
                _persistentObjectName = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }

        public Boolean BooleanField
        {
            get { return _booleanField; }
            set
            {
                _booleanField = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
        public Byte ByteField
        {
            get { return _byteField; }
            set
            {
                _byteField = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
        public Byte[] BytesField
        {
            get { return _bytesField; }
            set
            {
                _bytesField = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
        public Char CharField
        {
            get { return _charField; }
            set
            {
                _charField = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
        public Char[] CharsField
        {
            get { return _charsField; }
            set
            {
                _charsField = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
        public DateTime DatetimeField
        {
            get { return _datetimeField; }
            set
            {
                _datetimeField = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
        public Decimal DecimalField
        {
            get { return _decimalField; }
            set
            {
                _decimalField = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
        public Double DoubleField
        {
            get { return _doubleField; }
            set
            {
                _doubleField = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
        public Int16 Int16Field
        {
            get { return _int16Field; }
            set
            {
                _int16Field = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
        public Int32 Int32Field
        {
            get { return _int32Field; }
            set
            {
                _int32Field = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
        public Int64 Int64Field
        {
            get { return _int64Field; }
            set
            {
                _int64Field = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
        public SByte SByteField
        {
            get { return _sbyteField; }
            set
            {
                _sbyteField = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
        public Single SingleField
        {
            get { return _singleField; }
            set
            {
                _singleField = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
        public String StringField
        {
            get { return _stringField; }
            set
            {
                _stringField = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
        public UInt16 UInt16Field
        {
            get { return _uint16Field; }
            set
            {
                _uint16Field = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
        public UInt32 UInt32Field
        {
            get { return _uint32Field; }
            set
            {
                _uint32Field = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
        public UInt64 UInt64Field
        {
            get { return _uint64Field; }
            set
            {
                _uint64Field = value;
                _isDirty = true;
                _updated = DateTime.UtcNow;
            }
        }
    }
}
See Also