I haven't been particularly fond of the QL variants / query object trees one has to create in Java when using, for example, Hibernate. Wonderfully, db4o apparently lets you code 'native queries,' which are basically anonymous inner classes with a match method, where your query matching logic is simply a normal java expression on whatever objects are relevant to the query. So QL statements like "select blah from person p where name = ? and age > ?" becomes something like:
match (Person p) {
return (p.getName().equals("name to match") && p.getAge () > 21);
}
http://softcess.blogspot.com/2007/05/db4o-what-concept.html