public E get(Transaction txn, PK key, LockMode lockMode) throws DatabaseException { /* <!-- begin JE only --> */ if (DbCompat.IS_JE) { EntityResult<E> result = get( txn, key, Get.SEARCH, DbInternal.getReadOptions(lockMode)); return result != null ? result.value() : null; } /* <!-- end JE only --> */ DatabaseEntry keyEntry = new DatabaseEntry(); DatabaseEntry dataEntry = new DatabaseEntry(); keyBinding.objectToEntry(key, keyEntry); OperationStatus status = db.get(txn, keyEntry, dataEntry, lockMode); if (status == OperationStatus.SUCCESS) { return makeEntity(key, keyEntry, dataEntry); } else { return null; } }
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 --> */