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);
}
}
}
Aggregations