V returnValue(OpResult opResult) { V value; if (opResult.isSuccess()) { value = adapter.entryToValue(key, pkey, data); } else { value = null; } /* Clear entries to save memory. */ adapter.clearEntries(key, pkey, data); return value; }
public boolean update(V entity) throws DatabaseException { /* <!-- begin JE only --> */ if (DbCompat.IS_JE) { return update(entity, null) != null; } /* <!-- end JE only --> */ if (!updateAllowed) { throw new UnsupportedOperationException( "Update not allowed on a secondary index"); } checkInitialized(); adapter.valueToData(entity, data); return cursor.getCursor().putCurrent(data) == OperationStatus.SUCCESS; }
public OperationResult update(V entity, WriteOptions options) throws DatabaseException { if (!updateAllowed) { throw new UnsupportedOperationException( "Update not allowed on a secondary index"); } checkInitialized(); adapter.valueToData(entity, data); return cursor.getCursor().put(null, data, Put.CURRENT, options); } /* <!-- end JE only --> */