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>, org.springframework.data.repository.CrudRepository<T,I>
A Spring Data repository for Cloud Spanner with specific features.
- Since:
- 1.1
-
Method Summary
Modifier and TypeMethodDescriptionGets 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.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAllById, findById, save, saveAll
Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAll, findAll
-
Method Details
-
getSpannerTemplate
SpannerOperations getSpannerTemplate()Gets aSpannerOperations
, which allows more-direct access to Google Cloud Spanner functions.- Returns:
- the operations object providing Cloud Spanner functions.
-
performReadWriteTransaction
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
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.
-