1 21 package com.db4o.test; 22 23 import com.db4o.*; 24 import com.db4o.query.*; 25 import com.db4o.tools.*; 26 27 public class StoreObject { 28 29 Object _field; 30 31 public void storeOne() { 32 _field = new Object (); 33 } 34 35 public void testOne() { 36 37 Db4o.configure().objectClass(Object .class).cascadeOnActivate(true); 38 39 40 Query q = Test.query(); 41 q.constrain(new Object ()); 42 q.execute(); 43 44 Test.close(); 45 46 Statistics.main(new String []{Test.FILE_SOLO}); 47 48 Test.reOpen(); 49 50 q = Test.query(); 51 StoreObject template = new StoreObject(); 52 template._field = new Object (); 53 q.constrain(template); 54 q.execute(); 55 56 Test.close(); 57 58 Statistics.main(new String []{Test.FILE_SOLO}); 59 60 Test.reOpen(); 61 62 63 64 65 66 } 68 } 69 | Popular Tags |