public void testSerializeParentWithAccess () throws Exception {
File file = new File ("serialized.out");
ObjectOutputStream out = new ObjectOutputStream (new FileOutputStream (file));
Lazy1to1Parent parent = null;
Database db = _category.getDatabase();
db.begin();
parent = (Lazy1to1Parent) db.load(Lazy1to1Parent.class, new Integer (1));
assertParent(parent, 1, "parent 1");
assertChild(parent.getChild(), 1, "child 1");
db.commit();
out.writeObject (parent);
out.close();
ObjectInputStream in = new ObjectInputStream (new FileInputStream (file));
Lazy1to1Parent accountDeserialized = (Lazy1to1Parent) in.readObject ();
assertNotNull(accountDeserialized);
assertEquals(1, accountDeserialized.getId().intValue());
assertChild(accountDeserialized.getChild(), 1, "child 1");
db.close();
}