Package org.conserve

Examples of org.conserve.PersistenceManager.changeName()


    assertEquals(1,obj1.getValue());
    pm.close();
   
    //change long to int
    pm = new PersistenceManager(driver, database, login, password);
    pm.changeName(IntToLong.class, OriginalObject.class);
    pm.close();
    pm = new PersistenceManager(driver, database, login, password);
    pm.updateSchema(OriginalObject.class);
    pm.close();
    //check that the long is now null, since long can not fit in int
View Full Code Here


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

    // change string to long
    pm = new PersistenceManager(driver, database, login, password);
    pm.changeName(OriginalObject.class, StringToLong.class);
    pm.close();
    pm = new PersistenceManager(driver, database, login, password);
    pm.updateSchema(StringToLong.class);
    pm.close();
    //check that the long no longer exist
View Full Code Here

    pm.saveObject(obj1);
    pm.close();

    // change long to string
    pm = new PersistenceManager(driver, database, login, password);
    pm.changeName(StringToLong.class, OriginalObject.class);
    pm.close();
    pm = new PersistenceManager(driver, database, login, password);
    pm.updateSchema(OriginalObject.class);
    pm.close();
    // check that the string no longer exist
View Full Code Here

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

    // change array to long
    pm = new PersistenceManager(driver, database, login, password);
    pm.changeName(OriginalObject.class, ArrayToLong.class);
    pm.close();
    pm = new PersistenceManager(driver, database, login, password);
    pm.updateSchema(ArrayToLong.class);
    pm.close();
    //check that array no longer exist
View Full Code Here

    pm.saveObject(obj1);
    pm.close();

    //change long to array
    pm = new PersistenceManager(driver, database, login, password);
    pm.changeName(ArrayToLong.class, OriginalObject.class);
    pm.close();
    pm = new PersistenceManager(driver, database, login, password);
    pm.updateSchema(OriginalObject.class);
    pm.close();
    //make sure the array is null
View Full Code Here

    pm.saveObject(ns);

    pm.close();
    pm = new PersistenceManager(driver, database, login, password);
    // rename NotSubClass to SubClass
    pm.changeName(NotSubClass.class, SubClass.class);

    pm.close();
    pm = new PersistenceManager(driver, database, login, password);
    // change the database schema
    pm.updateSchema(SubClass.class);
View Full Code Here

    {
      assertTrue(oo instanceof SubClass);
    }

    // rename SubClass to to NotSubClass
    pm.changeName(SubClass.class, NotSubClass.class);
    // change the database schema
    pm.updateSchema(NotSubClass.class);

    // search all OriginalObject, make sure both objects are returned.
    res3 = pm.getObjects(OriginalObject.class, new All());
View Full Code Here

    pm.dropTable(Object.class);
    // create two OriginalObject, store them.
    pm.saveObject(new OriginalObject());
    pm.saveObject(new OriginalObject());
    // rename OriginalObject to ChangedInheritance
    pm.changeName(OriginalObject.class, ChangedInheritance.class);

    // change the database schema, adding interface Serialized.
    pm.updateSchema(ChangedInheritance.class);

    // search all Serializable, make sure both objects are returned
View Full Code Here

    List<OriginalObject> res3 = pm.getObjects(OriginalObject.class, new All());
    assertEquals(0, res3.size());

    // rename ChangedInheritance to OriginalObject, thus removing the
    // interface
    pm.changeName(ChangedInheritance.class, OriginalObject.class);
    // change the database schema
    pm.updateSchema(OriginalObject.class);

    // search all Serializable, make sure no objects are returned
    res1 = pm.getObjects(Serializable.class, new All());
View Full Code Here

    OriginalBottom b2 = new OriginalBottom();
    b2.setFoo(2);
    pm.saveObject(b1);
    pm.saveObject(b2);

    pm.changeName(OriginalTop.class, ModifiedTop.class);
    pm.changeName(OriginalMiddle.class, ModifiedMiddle.class);
    pm.changeName(OriginalBottom.class, ModifiedBottom.class);

    pm.updateSchema(ModifiedBottom.class);
    pm.close();
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.