3. Query API

We have already seen how to retrieve objects from db4o via QBE. While this approach is easy and intuitive, there are situations where it is not sufficient.
- There are queries that simply cannot be expressed with QBE: Retrieve all pilots with more than 100 points, for example.
- Creating a prototype object may have unwanted side effects.
- Default values (e.g. null) may not be accepted by the domain class constructor.
- We may want to query for field default values.
db4o provides a dedicated query API that can be used in those cases.
We need some pilots in our database again to explore it.
[storeFirstPilot]
Pilot pilot1 = new Pilot("Michael Schumacher", 100);
    db.set(pilot1);
    Console.WriteLine("Stored " + pilot1);
OUTPUT:
Stored Michael Schumacher/100

[storeSecondPilot]
Pilot pilot2 = new Pilot("Rubens Barrichello", 99);
    db.set(pilot2);
    Console.WriteLine("Stored " + pilot2);
OUTPUT:
Stored Rubens Barrichello/99