IObjectContainer.

Query<Extent>(Predicate<Extent>) Method

Summary

Native Query Interface.
Assembly
Db4objects.Db4o-2010.dll
Namespace
Db4objects.Db4o
Containing Type
IObjectContainer

Syntax

IList<Extent> Query<Extent>(Predicate<Extent> match)

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.

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

Type Parameters

Name Description
Extent

Parameters

Name Type Description
match Predicate<Extent>

Return Value

Type Description
IList<Extent> the query result