database.beginWrites();
database.deleteByQuery(Query.from(Draft.class).where("objectId = ?", objectId));
database.deleteByQuery(Query.from(History.class).where("objectId = ?", objectId));
database.deleteByQuery(Query.from(Trash.class).where("objectId = ?", objectId));
objectState.delete();
database.commitWrites();
} finally {
database.endWrites();
}
}
}