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.2.0.35246
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 the default hash function.
(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.)
Protected methodOnObjectUpdated
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_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;

                OnObjectUpdated();
            }
        }

        public Boolean BooleanField
        {
            get { return _booleanField; }
            set
            {
                _booleanField = value;

                OnObjectUpdated();
            }
        }
        public Byte ByteField
        {
            get { return _byteField; }
            set
            {
                _byteField = value;

                OnObjectUpdated();
            }
        }
        public Byte[] BytesField
        {
            get { return _bytesField; }
            set
            {
                _bytesField = value;

                OnObjectUpdated();
            }
        }
        public Char CharField
        {
            get { return _charField; }
            set
            {
                _charField = value;

                OnObjectUpdated();
            }
        }
        public Char[] CharsField
        {
            get { return _charsField; }
            set
            {
                _charsField = value;

                OnObjectUpdated();
            }
        }
        public DateTime DatetimeField
        {
            get { return _datetimeField; }
            set
            {
                _datetimeField = value;

                OnObjectUpdated();
            }
        }
        public Decimal DecimalField
        {
            get { return _decimalField; }
            set
            {
                _decimalField = value;

                OnObjectUpdated();
            }
        }
        public Double DoubleField
        {
            get { return _doubleField; }
            set
            {
                _doubleField = value;

                OnObjectUpdated();
            }
        }
        public Int16 Int16Field
        {
            get { return _int16Field; }
            set
            {
                _int16Field = value;

                OnObjectUpdated();
            }
        }
        public Int32 Int32Field
        {
            get { return _int32Field; }
            set
            {
                _int32Field = value;

                OnObjectUpdated();
            }
        }
        public Int64 Int64Field
        {
            get { return _int64Field; }
            set
            {
                _int64Field = value;

                OnObjectUpdated();
            }
        }
        public SByte SByteField
        {
            get { return _sbyteField; }
            set
            {
                _sbyteField = value;

                OnObjectUpdated();
            }
        }
        public Single SingleField
        {
            get { return _singleField; }
            set
            {
                _singleField = value;

                OnObjectUpdated();
            }
        }
        public String StringField
        {
            get { return _stringField; }
            set
            {
                _stringField = value;

                OnObjectUpdated();
            }
        }
        public UInt16 UInt16Field
        {
            get { return _uint16Field; }
            set
            {
                _uint16Field = value;

                OnObjectUpdated();
            }
        }
        public UInt32 UInt32Field
        {
            get { return _uint32Field; }
            set
            {
                _uint32Field = value;

                OnObjectUpdated();
            }
        }
        public UInt64 UInt64Field
        {
            get { return _uint64Field; }
            set
            {
                _uint64Field = value;

                OnObjectUpdated();
            }
        }
    }
}
See Also