Evaluations

Evaluations need to retrieve the actual object instance to be evaluated. That is why they do not work on a server without persistent classes:

Client.java: getPilotsEvaluation
01private static void getPilotsEvaluation() throws IOException { 02 System.out.println("Retrieving Pilot objects: Evaluation"); 03 ObjectContainer oc = Db4o.openClient("localhost", 0xdb40, "db4o","db4o"); 04 try { 05 Query query = oc.query(); 06 07 query.constrain(Pilot.class); 08 query.constrain(new Evaluation(){ 09 public void evaluate(Candidate candidate) { 10 Pilot pilot = (Pilot) candidate.getObject(); 11 candidate.include(pilot.getPoints() % 2 == 0); 12 } 13 }); 14 ObjectSet result = query.execute(); 15 listResult(result); 16 } finally { 17 oc.close(); 18 } 19 }