Search in sources :

Example 1 with CommitExpection

use of iBoxDB.LocalServer.E.CommitExpection in project divide by HiddenStage.

the class LocalStorageIBoxDb method save.

@Override
public void save(T1... objects) throws DAOException {
    for (TransientObject b : objects) {
        try {
            boolean exists = exists(b);
            System.out.println("Exists: " + exists);
            if (exists) {
                System.out.println("update: " + b.getObjectKey());
                box.update("Wrapper", new Wrapper(b));
            } else {
                System.out.println("insert: " + b.getObjectKey());
                box.insert("Wrapper", new Wrapper(b));
            }
        } catch (CommitExpection e) {
            e.printStackTrace();
            throw new DAOException(e);
        }
    }
}
Also used : TransientObject(io.divide.shared.transitory.TransientObject) CommitExpection(iBoxDB.LocalServer.E.CommitExpection)

Aggregations

CommitExpection (iBoxDB.LocalServer.E.CommitExpection)1 TransientObject (io.divide.shared.transitory.TransientObject)1