Ninja Database Pro
NinjaDbPro Class Members
Properties  Methods 


KellermanSoftware.NinjaDatabasePro Namespace : NinjaDbPro Class

The following tables list the members exposed by NinjaDbPro.

Public Constructors
 NameDescription
Public Constructor Constructor  
Top
Public Properties
 NameDescription
Public Property By default an interal cache of objects is maintained for performance. This is the time after which an item will be expired in the cache if it is not used. The default is 20 minutes for all platforms  
Public PropertyThe version of the database assembly  
Public PropertyThe path of the database directory  
Public PropertyAfter the database has been opened, this is the version of the database file  
Public PropertyThe name of the database  
Public PropertyGet the size of the data file size in bytes. This is the serialized data.  
Public PropertyThe data format for saving objects. The default is plain binary.  
Public Property Specify the block size for the encryption algorithm. Default is 128. AesManaged can only be 128  
Public Property Specify the key size for the encryption algorithm. Default is 128  
Public PropertyThe password to use when the EncodingFormat is EncryptedCompressed or Encrypted  
Public PropertyThe encryption salt to use when the EncodingFormat is EncryptedCompressed or Encrypted. The default is "PasswordSalt"  
Public Property Change out the encryption with hardware based or other encryption. Default encryption is AES  
Public PropertyGet the size of the index file in bytes. This is for the indexes and table definitions.  
Public Property Indexes are allocated in chunks to prevent needing to pack often. By default there is 1MB padding for each index.  
Public PropertyIf true, the datbase is open  
Public PropertyIf true, a transaction is open  
Public PropertyLicense Key for the licensed product (see your receipt)  
Public Property By default an interal cache of objects is maintained for performance. The default size 5MB  
Public Property Encrypt the external schema file. The Schema Encryption Password will be required to retrieve the schema. By default, the Schema is not encrypted.  
Public Property The size in bytes of the schema file  
Public PropertyWhere to store the data for the database. Default is IsolatedStorage.  
Public Property Get the total size in bytes of the database  
Public Property A list of actions to perform for a type when inserting, updating, or deleting. To create a trigger, create a class that implements the ITrigger interface.  
Public PropertyUser Name for the licensed product (see your receipt)  
Top
Public Methods
 NameDescription
Public MethodOverloaded. Add a custom composite index. See the SterlingCompositeIndex in the example directory for an example implementation.  
Public Method Add a full text index  
Public MethodOverloaded. Add a custom index for a single property value. See the SterlingSingleIndex in the example directory for an example implementation.  
Public MethodMake a backup of all database files into a backup directory  
Public Method Begin a bulk operation in a transaction.  
Public MethodStart a transaction to wrap a set of actions. Do a CommitTransaction to permanantly save the actions. Do a RollbackTranaction to undo all the actions in the transaction. If the Phone or PC loses power during a transaction it will automatically be rolled back on OpenDatabase.  
Public Method Clear All Lazy Loaded Values For All Indexes  
Public MethodClose the database  
Public Method Commit a bulk operation in a transaction.  
Public MethodCommit a transaction for a set of actions. Do a BeginTransaction to start the transaction. Do a RollbackTranaction to undo all the actions in the transaction. If the Phone or PC loses power during a transaction it will automatically be rolled back on OpenDatabase.  
Public MethodOverloaded.  Query all index records for the specified composite property index  
Public MethodOverloaded.  Query all index records for the specified single property index  
Public MethodCreate a linq query based on the object type. This performs a table scan returning only items that match the query. Loading by the primary key is fastest, followed by CreateIndexQuery.  
Public MethodOverloaded. Delete a specific object from the database The object must have a primary key property of Id or ObjectNameId as a type of long or an exception will be thrown. Example primary key: CustomerId  
Public MethodDelete a backup set  
Public MethodDelete the entire database. This action cannot be undone.  
Public Method Close the streams and release all resources  
Public MethodReturns true if the database exists that was specified in the constructor  
Public MethodExport the current database schema. The definition is the C# class.  
Public MethodExport all records of a table to an XML string  
Public Method Flush buffered data from the index stream and the data stream (this is done automatically on close and commit transaction)  
Public Method Get an index by name  
Public Method Get the next primary key that will be inserted for a type  
Public MethodImport records from an xml string to a table  
Public MethodOverloaded.  Returns true if the index exists for the passed in type and index name  
Public MethodOverloaded. Load an object from the database. The object must have a primary key property of Id or ObjectNameId as a type of long or an exception will be thrown. Example primary key: CustomerId If there is nothing found, null is returned.  
Public MethodLoad the entire list of an object type from the database ordered by the primary key Children and parents are not loaded. To load children and parents do a LoadAllWithChildren If there is nothing found, an empty list is returned.  
Public Method Load All Items sorted by the specified index. Only records that match the index value will be loaded.  
Public Method Load a list with all children populated  
Public Method Load a page of items ordered by the primary key  
Public Method Load a page of items, sorted by the specified index. Only records that match the index value will be loaded.  
Public Method Load a page of objects with all children populated, ordered by the primary key  
Public Method Load only the properties and fields specified. The format is the ClassName.PropertyName Performance is not increased, the properties are simply not populated to be used for synchronization scenarios.  
Public MethodLoad the Schema from the database  
Public MethodOpen the database before performing any operation. If the database does not exist it will automatically be created.  
Public MethodReclaim the space from previously deleted and updated items  
Public Method Normally, unused space is aggresively recovered when items are deleted or items are updated and do not fit into the same space. This method is already called internally both inside and outside of transactions. However, when using the BeginBulkOperation and CommitBulkOperation are used, unused space is not calculated. Call this method after a series of bulk operations.  
Public Method Reindex the passed in type.  
Public MethodRemove an index for the property of a type  
Public MethodRestore from a backup set to the current database  
Public Method Undo a bulk operation in progress.  
Public MethodUndo all actions in a transaction. Do a BeginTransaction to start the transaction. Do a CommitTransaction to permanantly save the actions. If the Phone or PC loses power during a transaction it will automatically be rolled back on OpenDatabase.  
Public MethodCount all objects of a specific type  
Public MethodOverloaded. The entire object graph will be saved to the database in an implicit transaction. If there is a problem saving any object, the implicit transation will be automatically rolled back. To save child or parents seperately, define relationships as atributes. The object must have a primary key property of Id or ObjectNameId as a type of long or an exception will be thrown. Example primary keys: Id or CustomerId If the primary is zero, the object will be inserted and set when it is saved. If the primary key is greater than zero the object will be updated. CreateDate, if defined will be filled in with the DateTime.Now during an insert UpdateDate, if defined will be filled in with the DateTime.Now during an update.  
Public Method Save only the specified fields or properties. The convention is ClassName.PropertyName There is no performance benefit. The purpose is to be used in synchronization scenarios.  
Public Method Normally the schema file is automatically updated when a new type is added or removed. Use this method to immediately overwrite the schema file when adding or changing the encryption password.  
Public Method Search a full text index by all keywords  
Public Method Search a full text index by any keywords  
Public Method Search a full text index by a regular expression  
Public Method Search a full text index by a phrase  
Public MethodDelete all objects of a specific type  
Top
See Also

Reference

NinjaDbPro Class
KellermanSoftware.NinjaDatabasePro Namespace