Class SimpleSpannerRepository<T,I>
java.lang.Object
com.google.cloud.spring.data.spanner.repository.support.SimpleSpannerRepository<T,I>
- Type Parameters:
T- the entity type of the repositoryI- the id type of the entity
- All Implemented Interfaces:
SpannerRepository<T,,I> org.springframework.data.repository.CrudRepository<T,,I> org.springframework.data.repository.PagingAndSortingRepository<T,,I> org.springframework.data.repository.Repository<T,I>
The default implementation of a SpannerRepository.
- Since:
- 1.1
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleSpannerRepository(SpannerTemplate spannerTemplate, Class<T> entityType) -
Method Summary
Modifier and TypeMethodDescriptionlongcount()voidvoidvoidvoiddeleteAllById(Iterable<? extends I> ids) voiddeleteById(Object id) booleanexistsById(I id) findAll()org.springframework.data.domain.Page<T>findAll(org.springframework.data.domain.Pageable pageable) findAll(org.springframework.data.domain.Sort sort) findAllById(Iterable<I> ids) Gets aSpannerOperations, which allows more-direct access to Google Cloud Spanner functions.<A> AperformReadOnlyTransaction(Function<SpannerRepository<T, I>, A> operations) Performs multiple read-only operations in a single transaction.<A> AperformReadWriteTransaction(Function<SpannerRepository<T, I>, A> operations) Performs multiple read and write operations in a single transaction.<S extends T>
Ssave(S entity)
-
Constructor Details
-
SimpleSpannerRepository
-
-
Method Details
-
getSpannerTemplate
Description copied from interface:SpannerRepositoryGets aSpannerOperations, which allows more-direct access to Google Cloud Spanner functions.- Specified by:
getSpannerTemplatein interfaceSpannerRepository<T,I> - Returns:
- the operations object providing Cloud Spanner functions.
-
performReadOnlyTransaction
Description copied from interface:SpannerRepositoryPerforms multiple read-only operations in a single transaction.- Specified by:
performReadOnlyTransactionin interfaceSpannerRepository<T,I> - 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.
-
performReadWriteTransaction
Description copied from interface:SpannerRepositoryPerforms multiple read and write operations in a single transaction.- Specified by:
performReadWriteTransactionin interfaceSpannerRepository<T,I> - 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.
-
save
-
saveAll
-
findById
-
existsById
-
findAll
-
findAllById
-
count
public long count() -
deleteById
-
delete
-
deleteAll
-
deleteAll
public void deleteAll() -
findAll
-
findAll
public org.springframework.data.domain.Page<T> findAll(org.springframework.data.domain.Pageable pageable) -
deleteAllById
-