@Override public boolean exists(final Object id, final Class<?> entityClass) throws DataAccessException { try { return _collection(entityClass).documentExists(determineDocumentKeyFromId(id)); } catch (final ArangoDBException e) { throw translateExceptionIfPossible(e); } }
@Override public boolean exists(final Object id, final Class<?> entityClass) throws DataAccessException { try { return _collection(entityClass).documentExists(determineDocumentKeyFromId(id)); } catch (final ArangoDBException e) { throw translateExceptionIfPossible(e); } }
@Override public <K, V> void put(K key, V value) throws NullPointerException { Objects.requireNonNull(key, "Key is required"); Objects.requireNonNull(value, "value is required"); BaseDocument baseDocument = new BaseDocument(); baseDocument.setKey(key.toString()); baseDocument.addAttribute(VALUE, JSONB.toJson(value)); if (arangoDB.db(bucketName).collection(namespace).documentExists(key.toString())) { arangoDB.db(bucketName).collection(namespace).deleteDocument(key.toString()); } arangoDB.db(bucketName).collection(namespace) .insertDocument(baseDocument); }