1 21 package com.db4o.test; 22 23 import com.db4o.*; 24 import com.db4o.query.*; 25 26 27 public class MultipleEvaluationGetObjectCalls { 28 29 public String name; 30 31 public void storeOne(){ 32 name="hello"; 33 } 34 35 public void test(){ 36 Query q = Test.query(); 37 q.constrain(getClass()); 38 q.descend("name").constrain(new Evaluation() { 39 public void evaluate(Candidate candidate) { 40 boolean include = ((String )candidate.getObject()).startsWith("h") 41 && ((String )candidate.getObject()).endsWith("o"); 42 candidate.include(include); 43 } 44 }); 45 ObjectSet objectSet = q.execute(); 46 Test.ensure(objectSet.size() == 1); 47 } 48 } 49 | Popular Tags |