Package org.conserve

Examples of org.conserve.PersistenceManager.changeName()


    oo.setValue(value);
    oo.setOtherObject(otherObject);
    oo.setRedundantObject(redundantObject);
    pm.saveObject(oo);
    // rename the table
    pm.changeName(OriginalObject.class, NewName.class);
    // get all NewName objects
    List<NewName> res = pm.getObjects(NewName.class, new All());
    assertEquals(res.size(), 1);
    // make sure all properties match
    NewName nn = res.get(0);
View Full Code Here


    oo.setValue(value);
    oo.setOtherObject(otherObject);
    oo.setRedundantObject(redundantObject);
    pm.saveObject(oo);
    // rename the table
    pm.changeName(OriginalObject.class, RenamedColumn.class);
    // update schema
    pm.renameProperties(RenamedColumn.class);

    // get all RenamedColumn objects
    List<RenamedColumn> res1 = pm.getObjects(RenamedColumn.class, new All());
View Full Code Here

    assertEquals(name, nn.getName());
    assertEquals(otherObject, nn.getOtherObject());
    assertEquals(redundantObject, nn.getRenamedObject());

    // change everything back
    pm.changeName(RenamedColumn.class, OriginalObject.class);
    pm.renameProperties(OriginalObject.class);

    // get all OriginalObject objects
    List<OriginalObject> res2 = pm.getObjects(OriginalObject.class, new All());
    assertEquals(res2.size(), 1);
View Full Code Here

    oo.setValue(value);
    oo.setOtherObject(otherObject);
    oo.setRedundantObject(redundantObject);
    pm.saveObject(oo);
    // rename the table
    pm.changeName(OriginalObject.class, RemovedColumn.class);
    // update schema
    pm.updateSchema(RemovedColumn.class);

    // get all RemovedColumn objects
    List<RemovedColumn> res1 = pm.getObjects(RemovedColumn.class, new All());
View Full Code Here

    // make sure no SimplestObject entries are left
    List<SimplestObject> simpleRes = pm.getObjects(SimplestObject.class, new All());
    assertEquals(0, simpleRes.size());

    // change everything back
    pm.changeName(RemovedColumn.class, OriginalObject.class);
    pm.updateSchema(OriginalObject.class);

    // get all OriginalObject objects
    List<OriginalObject> res2 = pm.getObjects(OriginalObject.class, new All());
    assertEquals(res2.size(), 1);
View Full Code Here

    pm.saveObject(oo);
    pm.close();

    // change object to long
    pm = new PersistenceManager(driver, database, login, password);
    pm.changeName(OriginalObject.class, ObjectToLong.class);
    pm.close();
    pm = new PersistenceManager(driver, database, login, password);
    pm.updateSchema(ObjectToLong.class);
    pm.close();
    //check that objects exist/not exist
View Full Code Here

    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);
View Full Code Here

    pm.saveObject(oo2);
    pm.close();

    // change object to subclass
    pm = new PersistenceManager(driver, database, login, password);
    pm.changeName(OriginalObject.class, ObjectToSubclass.class);
    pm.close();
    pm = new PersistenceManager(driver, database, login, password);
    pm.updateSchema(ObjectToSubclass.class);
    pm.close();
    //check that objects exist/not exist
View Full Code Here

    assertTrue(obj.getName().equals(name));
    assertNotNull(obj.getOtherObject());
   
    //change subclass to superclass
    pm = new PersistenceManager(driver, database, login, password);
    pm.changeName(ObjectToSubclass.class, OriginalObject.class);
    pm.close();
    pm = new PersistenceManager(driver, database, login, password);
    pm.updateSchema(OriginalObject.class);
    List<OriginalObject>res2 = pm.getObjects(OriginalObject.class, new All());
    assertEquals(2,res2.size());
View Full Code Here

    pm.saveObject(oo);
    pm.close();

    // change int to long
    pm = new PersistenceManager(driver, database, login, password);
    pm.changeName(OriginalObject.class, IntToLong.class);
    pm.close();
    pm = new PersistenceManager(driver, database, login, password);
    pm.updateSchema(IntToLong.class);
    pm.close();
    //check that the integer has been changed into a long
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.