public boolean delete() throws DatabaseException { /* <!-- begin JE only --> */ if (DbCompat.IS_JE) { return delete(null) != null; } /* <!-- end JE only --> */ checkInitialized(); return cursor.getCursor().delete() == OperationStatus.SUCCESS; }
public V current() throws DatabaseException { return current(null); }
public V first() throws DatabaseException { return first(null); }
public V nextDup(LockMode lockMode) throws DatabaseException { checkInitialized(); return returnValue( cursor.getNextDup(key, pkey, data, OpReadOptions.make(lockMode))); }
public int count() throws DatabaseException { checkInitialized(); return cursor.count(); }
public EntityCursor<V> dup() throws DatabaseException { return new BasicCursor<V>(cursor.dup(true), adapter, updateAllowed); }
public V nextDup() throws DatabaseException { return nextDup(null); }
public V last() throws DatabaseException { return last(null); }
public V next() throws DatabaseException { return next(null); }
public Iterator<V> iterator() { return iterator(null); }
public EntityResult<V> get(Get getType, ReadOptions options) throws DatabaseException { switch (getType) { case NEXT_DUP: return null; case NEXT_NO_DUP: return super.get(Get.NEXT, options); case PREV_DUP: return null; case PREV_NO_DUP: return super.get(Get.PREV, options); default: return super.get(getType, options); } } /* <!-- end JE only --> */
public V current(LockMode lockMode) throws DatabaseException { checkInitialized(); return returnValue( cursor.getCurrent(key, pkey, data, OpReadOptions.make(lockMode))); }
public OperationResult delete(WriteOptions options) throws DatabaseException { checkInitialized(); return cursor.getCursor().delete(options); } /* <!-- end JE only --> */
private <V> EntityCursor<V> cursor(Transaction txn, KeyRange range, ValueAdapter<V> adapter, CursorConfig config) throws DatabaseException { Cursor cursor = db.openCursor(txn, config); RangeCursor rangeCursor = new RangeCursor(range, null/*pkRange*/, sortedDups, cursor); return new BasicCursor<V>(rangeCursor, adapter, isUpdateAllowed()); }
public V prevDup(LockMode lockMode) throws DatabaseException { checkInitialized(); return returnValue( cursor.getPrevDup(key, pkey, data, OpReadOptions.make(lockMode))); }
public long countEstimate() throws DatabaseException { checkInitialized(); return cursor.getCursor().countEstimate(); } /* <!-- end JE only --> */
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 --> */