updateDoc.addAttribute(field.getKey(), byteIteratorToString(field.getValue())); arangoDB.db(databaseName).collection(table).updateDocument(key, updateDoc); return Status.OK; } else {
@Override public DocumentEntity update(final Object id, final Object value, final DocumentUpdateOptions options) throws DataAccessException { potentiallyEmitEvent(new BeforeSaveEvent<>(value)); final DocumentEntity result; try { result = _collection(value.getClass(), id).updateDocument(determineDocumentKeyFromId(id), toVPack(value), options); } catch (final ArangoDBException e) { throw translateExceptionIfPossible(e); } updateDBFields(value, result); potentiallyEmitEvent(new AfterSaveEvent<>(value)); return result; }
@Override public DocumentEntity update(final Object id, final Object value, final DocumentUpdateOptions options) throws DataAccessException { potentiallyEmitEvent(new BeforeSaveEvent<>(value)); final DocumentEntity result; try { result = _collection(value.getClass(), id).updateDocument(determineDocumentKeyFromId(id), toVPack(value), options); } catch (final ArangoDBException e) { throw translateExceptionIfPossible(e); } updateDBFields(value, result); potentiallyEmitEvent(new AfterSaveEvent<>(value)); return result; }
@Override public DocumentEntity update(DocumentEntity entity) { String collectionName = entity.getName(); checkCollection(collectionName); BaseDocument baseDocument = getBaseDocument(entity); DocumentUpdateEntity<BaseDocument> arandoDocument = arangoDB.db(database) .collection(collectionName).updateDocument(baseDocument.getKey(), baseDocument); updateEntity(entity, arandoDocument.getKey(), arandoDocument.getId(), arandoDocument.getRev()); return entity; }