1 21 package com.db4o.test.pending; 22 23 import com.db4o.*; 24 import com.db4o.query.*; 25 import com.db4o.test.*; 26 27 28 public class IndexOnParentClass { 29 30 public String name; 31 32 public void configure(){ 33 Db4o.configure().objectClass(this).objectField("name").indexed(true); 34 } 35 36 public void store(){ 37 IndexOnParentClass p = new IndexOnParentClass(); 38 p.name = "all"; 39 Test.store(p); 40 p = new ChildClass(); 41 p.name = "all"; 42 Test.store(p); 43 } 44 45 public void test(){ 46 Query q = Test.query(); 47 q.constrain(ChildClass.class); 48 q.descend("name").constrain("all"); 49 int size = q.execute().size(); 50 System.out.println(size); 51 Test.ensure(size == 1); 52 } 53 54 public static class ChildClass extends IndexOnParentClass{ 55 56 } 57 } 58 | Popular Tags |