public abstract class TransactionWrappingFinder<T> extends Object implements SingleFetcher<T>, ManyFetcher<T>
SingleFetcher
and
ManyFetcher
methods in a
transaction template, so that we ensure all results are returned in (at least) the same read only
transaction.Constructor and Description |
---|
TransactionWrappingFinder(SingleFetcher<T> singleFetcherDelegate,
ManyFetcher<T> manyFetcherDelegate,
TransactionalHostContextAccessor hostContextAccessor) |
Modifier and Type | Method and Description |
---|---|
protected <TYPE> TYPE |
executeReadOnly(ThrowingTransactionCallback<TYPE,NotFoundException> callback) |
Optional<T> |
fetch() |
PageResponse<T> |
fetchMany(PageRequest request) |
com.atlassian.fugue.Option<T> |
fetchOne() |
T |
fetchOneOrNull() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fetchOrNull
public TransactionWrappingFinder(SingleFetcher<T> singleFetcherDelegate, ManyFetcher<T> manyFetcherDelegate, TransactionalHostContextAccessor hostContextAccessor)
public PageResponse<T> fetchMany(PageRequest request) throws NotFoundException
fetchMany
in interface ManyFetcher<T>
request
- - a pageRequest to use to paginate the response, this will be limited if it exceeds system limitsNotFoundException
protected <TYPE> TYPE executeReadOnly(ThrowingTransactionCallback<TYPE,NotFoundException> callback) throws NotFoundException
NotFoundException
public com.atlassian.fugue.Option<T> fetchOne()
fetchOne
in interface SingleFetcher<T>
public Optional<T> fetch()
fetch
in interface SingleFetcher<T>
public T fetchOneOrNull()
fetchOneOrNull
in interface SingleFetcher<T>
Copyright © 2003–2020 Atlassian. All rights reserved.