Click or drag to resize

ObjectDb Class

Implementation of the ESENT backed object database. For historical reasons, a private constructor ensures that callers do not create an instance of this class directly, but they must use one of the Create factory methods which return a IObjectDbEsent interface.
Inheritance Hierarchy
SystemObject
  Orthogonal.ObjectDb.EsentObjectDb

Namespace:  Orthogonal.ObjectDb.Esent
Assembly:  Orthogonal.ObjectDb.Esent (in Orthogonal.ObjectDb.Esent.dll) Version: 4.0.0
Syntax
C#
public sealed class ObjectDb : IObjectDbEsent, 
	IDisposable

The ObjectDb type exposes the following members.

Properties
  NameDescription
Public propertyThrowOnTruncate

Gets or sets a flag indicating if the library should thrown an Exception if an attempt is made to save a string or byte array property value that does not fit into the database column. The default value is True. Setting this property to False will cause silent truncation of values that are too long which is the default behaviour of the library in versions prior to 3.1.

Top
Methods
  NameDescription
Public methodStatic memberCreate(DirectoryInfo)
Constructs and opens an object database in a specified folder. The folder and database files in that folder will be created if they don't exist. The core database file in the folder will be named objectdb.edb.
Public methodStatic memberCreate(FileInfo)

Constructs and opens an object database using a specified core database file. The file will be created if it doesn't exist. Other support database files (log, journal, etc) will be created as siblings of the core database file.

If for example the database file is specified as C:\temp\dbtesting\myproduct.edb then the folder C:\temp\dbtesting will contain the core database file myproduct.edb as well as other supporting files that comprise the full database.

Public methodStatic memberCreate(String)
Constructs and opens an object database in a specified folder. The folder and database files in that folder will be created if they don't exist. The core database file in the folder will be named objectdb.edb.
Public methodDeleteT
Deletes an object from the database by primary key.
Public methodDeleteAllT
Deletes all objects of a type from the database.
Public methodDispose
Disposes of the ESENT database and any native resources it holds.
Public methodExport
Exports all data and schema information as an XML element to a stream. The shape and contents of the XML is specific to each Object Database implementation. It is desirable that the Export and Import(Stream) methods can exchange the XML.
Public methodFindFirstByIndexT
Finds the first object in the database with a property value that equals a search value.
Public methodGetT
Gets an object from the database by primary key.
Public methodGetByIndexT
Gets objects from the database by an index over a non primary key property. Because non primary index values may not be unique, a set of results is returned.
Public methodGetObjectNames
Gets the names of all object types stored in the database.
Public methodGetPropertyNames
Gets the names of all properties stored in the database for a given object name.
Public methodGetSchema
Gets the internal structure of the object database as a shaped XML element. This method is only intended to be used for debugging purposes and may only be meaningful for implementations that use a backing storage which supports the concept of a schema.
Public methodImport
Imports all data and schema information from an XML element in a stream. It is desirable that the Import and Export(Stream) methods can exchange the XML.
Public methodInsertT
Inserts a single object into the database. Non identity primary key property value(s) must be set. All public readable and writable property values of the inserted item object are saved. An exception is thrown if the primary key already exists.
Public methodInsertManyT
Inserts a set of objects into the database using a single transaction. All public readable and writable property values of the inserted item objects are saved. Non identity primary key property value(s) must be set. An exception is thrown if the primary key of any item already exists.
Public methodListT
Lists (enumerates) all objects of a type over the primary key index.
Public methodListT(SeekType, Object)
Lists (enumerates) all objects of a type over the primary key index starting at a specified seek position.
Public methodListByIndexT(String)
Lists (enumerates) all objects of a type over an alternative key index.
Public methodListByIndexT(String, SeekType, Object)
Lists (enumerates) all objects of a type over an alternative key index starting at a specified seek position.
Public methodSaveT
Saves an object into the database, either adding the object if the primary key does not exist, or replacing the data in an existing record with the primary key.
Public methodUpdateT
Updates data in an existing record by primary key. The primary key property value(s) must be set to locate the record to be updated.
Top
See Also