1 21 package com.db4o.test; 22 23 import com.db4o.ext.*; 24 25 28 public class DeepSet { 29 30 public DeepSet child; 31 public String name; 32 33 public void storeOne(){ 34 name = "1"; 35 child = new DeepSet(); 36 child.name = "2"; 37 child.child = new DeepSet(); 38 child.child.name = "3"; 39 } 40 41 public void test(){ 42 ExtObjectContainer oc = Test.objectContainer(); 43 name = "1"; 44 DeepSet ds = (DeepSet)oc.get(this).next(); 45 ds.name="11"; 46 ds.child.name = "12"; 47 oc.set(ds, 2); 48 oc.deactivate(ds, Integer.MAX_VALUE); 49 name = "11"; 50 ds = (DeepSet)oc.get(this).next(); 51 Test.ensure(ds.child.name.equals("12")); 52 Test.ensure(ds.child.child.name.equals("3")); 53 } 54 55 } 56 | Popular Tags |