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 <T> T |
executeReadOnly(ThrowingTransactionCallback<T,NotFoundException> callback) |
PageResponse<T> |
fetchMany(PageRequest request) |
com.atlassian.fugue.Option<T> |
fetchOne() |
T |
fetchOneOrNull() |
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 <T> T executeReadOnly(ThrowingTransactionCallback<T,NotFoundException> callback) throws NotFoundException
NotFoundException
public com.atlassian.fugue.Option<T> fetchOne()
fetchOne
in interface SingleFetcher<T>
public T fetchOneOrNull()
fetchOneOrNull
in interface SingleFetcher<T>
Copyright © 2003–2016 Atlassian. All rights reserved.