Search Results for

    Show / Hide Table of Contents
    note

    VeloxDB is still in beta and APIs are subject to change. We are in the process of completing the documentation, so some sections may be incomplete or empty at this time.

    Class DatabaseObject

    The ultimate base class of all VeloxDB database classes. Derive this class to implement a database class.

    Inheritance
    object
    DatabaseObject
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: VeloxDB.ObjectInterface
    Assembly: vlxdb.dll
    Syntax
    public abstract class DatabaseObject

    Constructors

    DatabaseObject()

    Declaration
    protected DatabaseObject()

    Properties

    CanBeAbandoned

    Gets if the object can be abandoned. Inserted, updated and deleted objects can't be abandoned. See Abandon().

    Declaration
    public bool CanBeAbandoned { get; }
    Property Value
    Type Description
    bool

    Id

    Gets DatabaseObject's Id.

    Declaration
    public long Id { get; }
    Property Value
    Type Description
    long
    Remarks

    DatabaseObject has an Id that is auto assigned by the database. The id represents primary key, it is unique for all database objects, across all types. The id is never reused even if the object is deleted. If you need additional keys use HashIndexAttribute or SortedIndexAttribute with IsUnique set to true.

    IsAbandoned

    Gets if the object is abandoned. Objects are abandoned with Abandon().

    Declaration
    public bool IsAbandoned { get; }
    Property Value
    Type Description
    bool

    IsCreated

    Gets if the object is created.

    Declaration
    public bool IsCreated { get; }
    Property Value
    Type Description
    bool

    IsDeleted

    Gets if the object is deleted.

    Declaration
    public bool IsDeleted { get; }
    Property Value
    Type Description
    bool

    IsSelected

    Gets or sets if the object is selected for conversion to DTO.

    Declaration
    public bool IsSelected { get; set; }
    Property Value
    Type Description
    bool

    Owner

    Get's the DatabaseObject's object model.

    Declaration
    public ObjectModel Owner { get; }
    Property Value
    Type Description
    ObjectModel

    Methods

    Abandon()

    Tells ObjectModel that it doesn't have to keep the reference to the object any more.

    Declaration
    public void Abandon()
    Remarks

    VeloxDB keeps data in internal unmanaged structures. When accessing objects through ObjectModel VeloxDB creates object oriented wrappers to access these structures. Besides providing access, these objects also store changes made in the transaction (updates, deletion). These objects are kept for the duration of the transaction and discarded once the transaction is done. If you only read an object and know that you wont be reading it again, you can call Abandon() to signal the database that it doesn't have to keep the object around.

    Exceptions
    Type Condition
    InvalidOperationException

    DatabaseObject is created, updated or deleted.

    Delete()

    Marks the object as deleted.

    Declaration
    public void Delete()

    Select()

    Select the object for conversion to DTO.

    Declaration
    public void Select()
    In this article
    © 2025 Copyright: VeloxDB