pm = new PersistenceManager(driver, database, login, password);
pm.updateSchema(ObjectToLong.class);
pm.close();
//check that objects exist/not exist
pm = new PersistenceManager(driver, database, login, password);
List<ObjectToLong>res = pm.getObjects(ObjectToLong.class, new All());
assertEquals(1,res.size());
ObjectToLong tmp = res.get(0);
assertTrue(tmp.getName().equals(name));
assertNull(tmp.getOtherObject());
tmp.setOtherObject(42L);
pm.saveObject(tmp);
//check that the dependent object has been dropped
List<SimpleObject>dependents = pm.getObjects(SimpleObject.class, new All());
assertEquals(0,dependents.size());
pm.close();
// change long to object
pm = new PersistenceManager(driver, database, login, password);
pm.changeName(ObjectToLong.class, OriginalObject.class);
pm.close();
pm = new PersistenceManager(driver, database, login, password);
pm.updateSchema(OriginalObject.class);
pm.close();
pm = new PersistenceManager(driver, database, login, password);
List<OriginalObject>res1 = pm.getObjects(OriginalObject.class, new All());
assertEquals(1,res1.size());
OriginalObject tmp1 = res1.get(0);
assertNull(tmp1.getOtherObject());
tmp1.setOtherObject(new SimpleObject());
pm.saveObject(tmp1);