Interface SpannerRepository<T,I>
-
- Type Parameters:
T
- the entity type of the repositoryI
- the id type of the entity
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<T,I>
,org.springframework.data.repository.PagingAndSortingRepository<T,I>
,org.springframework.data.repository.Repository<T,I>
- All Known Implementing Classes:
SimpleSpannerRepository
public interface SpannerRepository<T,I> extends org.springframework.data.repository.PagingAndSortingRepository<T,I>
A Spring Data repository for Cloud Spanner with specific features.- Since:
- 1.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SpannerOperations
getSpannerTemplate()
Gets aSpannerOperations
, which allows more-direct access to Google Cloud Spanner functions.<A> A
performReadOnlyTransaction(Function<SpannerRepository<T,I>,A> operations)
Performs multiple read-only operations in a single transaction.<A> A
performReadWriteTransaction(Function<SpannerRepository<T,I>,A> operations)
Performs multiple read and write operations in a single transaction.
-
-
-
Method Detail
-
getSpannerTemplate
SpannerOperations getSpannerTemplate()
Gets aSpannerOperations
, which allows more-direct access to Google Cloud Spanner functions.- Returns:
- the operations object providing Cloud Spanner functions.
-
performReadWriteTransaction
<A> A performReadWriteTransaction(Function<SpannerRepository<T,I>,A> operations)
Performs multiple read and write operations in a single transaction.- Type Parameters:
A
- the final return type of the operations.- Parameters:
operations
- the function representing the operations to perform using a SpannerRepository based on a single transaction.- Returns:
- the final result of the transaction.
-
performReadOnlyTransaction
<A> A performReadOnlyTransaction(Function<SpannerRepository<T,I>,A> operations)
Performs multiple read-only operations in a single transaction.- Type Parameters:
A
- the final return type of the operations.- Parameters:
operations
- the function representing the operations to perform using a SpannerRepository based on a single transaction.- Returns:
- the final result of the transaction.
-
-