Package org.jitterbit.integration.database.info

Examples of org.jitterbit.integration.database.info.DatabaseObjectPersistor


    }

    private void restoreObjects(Persistor p) {
        objects = Maps.newHashMap();
        Persistor root = p.getFirstChild("Objects");
        DatabaseObjectPersistor op = new DatabaseObjectPersistor();
        for (Persistor item : root.getChildren("Item")) {
            objects.put(op.restoreFrom(item.getFirstChild("Object")), item.getInteger("value"));
        }
    }
View Full Code Here


        }
    }

    private void writeObjects(Persistor p) {
        Persistor root = p.createChild("Objects");
        DatabaseObjectPersistor op = new DatabaseObjectPersistor();
        for (DatabaseObject o : objects.keySet()) {
            if (o == null) {
                // When upgrading from certain pre-release 2.0 versions we may end up in the
                // situation where objects contains null-keys. If that happens we must erase
                // all restored objects information and pretend it was never there in the first
                // place, otherwise we risk ending up in an inconsistent state.
                return;
            }
        }
        for (Map.Entry<DatabaseObject, Integer> e : objects.entrySet()) {
            Persistor item = root.createChild("Item");
            op.save(e.getKey(), item.createChild("Object"));
            item.putInteger("value", e.getValue());
        }
    }
View Full Code Here

TOP

Related Classes of org.jitterbit.integration.database.info.DatabaseObjectPersistor

Copyright © 2018 www.massapicom. 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.