diff options
| author | mo khan <mo@mokhan.ca> | 2009-10-23 13:09:04 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2009-10-23 13:09:04 -0600 |
| commit | 9a3430b2a1f0445c0dbac703907762e225383421 (patch) | |
| tree | 751d5742a199eae57ebb6d767e650bd6c803bdc3 /product/database/db4o/ObjectDatabaseConnection.cs | |
| parent | f76fe6ca01f3dc5fabc8bf16f299420ba9d7ef05 (diff) | |
renamed some components to something that is more descriptive.main
Diffstat (limited to 'product/database/db4o/ObjectDatabaseConnection.cs')
| -rw-r--r-- | product/database/db4o/ObjectDatabaseConnection.cs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/product/database/db4o/ObjectDatabaseConnection.cs b/product/database/db4o/ObjectDatabaseConnection.cs new file mode 100644 index 0000000..7149d25 --- /dev/null +++ b/product/database/db4o/ObjectDatabaseConnection.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using Db4objects.Db4o; +using momoney.database.transactions; + +namespace momoney.database.db4o +{ + public class ObjectDatabaseConnection : DatabaseConnection + { + readonly IObjectContainer container; + + public ObjectDatabaseConnection(IObjectContainer container) + { + this.container = container; + } + + public void Dispose() + { + container.Close(); + container.Dispose(); + } + + public IEnumerable<T> query<T>() + { + return container.Query<T>(); + } + + public IEnumerable<T> query<T>(Predicate<T> predicate) + { + return container.Query(predicate); + } + + public void delete<T>(T entity) + { + container.Delete(entity); + } + + public void commit() + { + container.Commit(); + } + + public void store<T>(T entity) + { + container.Store(entity); + } + } +}
\ No newline at end of file |
