Summary
Native Query Interface.
- Assembly
- Db4objects
.Db4o-2010 .dll - Namespace
- Db4objects
.Db4o - Containing Type
- IObjectContainer
Syntax
IObjectSet Query(Predicate predicate)
Remarks
Native Query Interface.
Prefer LINQ over Native Queries.
Make sure that you reference Db4objects.Db4o.NativeQueries.dll, Mono.Cecil.dll and Cecil.FlowAnalysis.dll in your application when using native queries.
db4o will attempt to optimize native query expressions and execute them against indexes and without instantiating actual objects. Otherwise db4o falls back and instantiates objects to run them against the given predicate. That is an order of magnitude slower than a optimized native query.
In order to execute a Native Query, you provide a predicate delegate
Prefer LINQ over Native Queries.
Make sure that you reference Db4objects.Db4o.NativeQueries.dll, Mono.Cecil.dll and Cecil.FlowAnalysis.dll in your application when using native queries.
db4o will attempt to optimize native query expressions and execute them against indexes and without instantiating actual objects. Otherwise db4o falls back and instantiates objects to run them against the given predicate. That is an order of magnitude slower than a optimized native query.
IList<Cat> cats = db.query(delegate(Cat) { return cat.getName().equals("Occam")});
Summing up the above:In order to execute a Native Query, you provide a predicate delegate
Parameters
Name | Type | Description |
---|---|---|
predicate | Predicate | the predicate containing the native query expression. |
Return Value
Type | Description |
---|---|
IObjectSet | the query result |