EntityResult<V> returnResult(OpResult opResult) { V value = returnValue(opResult); return (value != null) ? new EntityResult<>(value, opResult.jeResult) : null; } /* <!-- end JE only --> */
public EntityResult<E> get(Transaction txn, PK key, Get getType, ReadOptions options) throws DatabaseException { checkGetType(getType); DatabaseEntry keyEntry = new DatabaseEntry(); DatabaseEntry dataEntry = new DatabaseEntry(); keyBinding.objectToEntry(key, keyEntry); OperationResult result = db.get( txn, keyEntry, dataEntry, getType, options); if (result != null) { return new EntityResult<>( makeEntity(key, keyEntry, dataEntry), result); } else { return null; } } /* <!-- end JE only --> */
public EntityResult<E> get(Transaction txn, PK key, Get getType, ReadOptions options) throws DatabaseException { BasicIndex.checkGetType(getType); DatabaseEntry pkeyEntry = new DatabaseEntry(); DatabaseEntry dataEntry = new DatabaseEntry(); pkeyBinding.objectToEntry(key, pkeyEntry); OperationResult result = db.get( txn, keyEntry, pkeyEntry, dataEntry, Get.SEARCH_BOTH, options); if (result != null) { return new EntityResult<>( (E) entityBinding.entryToObject(pkeyEntry, dataEntry), result); } else { return null; } } /* <!-- end JE only --> */
public EntityResult<PK> get(Transaction txn, SK key, Get getType, ReadOptions options) throws DatabaseException { checkGetType(getType); DatabaseEntry keyEntry = new DatabaseEntry(); DatabaseEntry pkeyEntry = new DatabaseEntry(); keyBinding.objectToEntry(key, keyEntry); OperationResult result = db.get( txn, keyEntry, pkeyEntry, getType, options); if (result != null) { return new EntityResult<>( (PK) pkeyBinding.entryToObject(pkeyEntry), result); } else { return null; } } /* <!-- end JE only --> */
public EntityResult<E> get(Transaction txn, SK key, Get getType, ReadOptions options) throws DatabaseException { checkGetType(getType); DatabaseEntry keyEntry = new DatabaseEntry(); DatabaseEntry pkeyEntry = new DatabaseEntry(); DatabaseEntry dataEntry = new DatabaseEntry(); keyBinding.objectToEntry(key, keyEntry); OperationResult result = secDb.get( txn, keyEntry, pkeyEntry, dataEntry, getType, options); if (result != null) { return new EntityResult<>( entityBinding.entryToObject(pkeyEntry, dataEntry), result); } else { return null; } } /* <!-- end JE only --> */