}
db.commit();
}
} else if (arg instanceof EntitiesAction) {
// domain model session, but no transaction
EntitiesAction action = (EntitiesAction) arg;
IEntities entities = action.getEntities();
String actionName = action.getName();
IEntity entity = action.getEntity();
ObjectContainer db = getDb();
if (actionName.equals("add")) {
db.set(entity);
db.set(entities);
} else if (actionName.equals("remove")) {
db.set(entities);
db.delete(entity);
} else if (actionName.equals("update")) {
IEntity updateEntity = action.getEntity();
db.set(updateEntity);
} else if (actionName.equals("attach")) {
db.set(entities);
} else if (actionName.equals("detach")) {
db.set(entities);
}
db.commit();
}
} else if (arg instanceof EntitiesAction) {
// no domain model session
EntitiesAction action = (EntitiesAction) arg;
IEntities entities = action.getEntities();
String actionName = action.getName();
IEntity entity = action.getEntity();
ObjectContainer db = getDb();
if (actionName.equals("add")) {
db.set(entity);
db.set(entities);
} else if (actionName.equals("remove")) {
db.set(entities);
db.delete(entity);
} else if (actionName.equals("update")) {
IEntity updateEntity = action.getEntity();
db.set(updateEntity);
} else if (actionName.equals("attach")) {
db.set(entities);
} else if (actionName.equals("detach")) {
db.set(entities);