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
ConstructorDescriptionSimpleSpannerRepository
(SpannerTemplate spannerTemplate, Class<T> entityType) -
Method Summary
Modifier and TypeMethodDescriptionlong
count()
void
void
void
void
deleteAllById
(Iterable<? extends I> ids) void
deleteById
(Object id) boolean
existsById
(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> 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.<S extends T>
Ssave
(S entity)
-
Constructor Details
-
SimpleSpannerRepository
-
-
Method Details
-
getSpannerTemplate
Description copied from interface:SpannerRepository
Gets aSpannerOperations
, which allows more-direct access to Google Cloud Spanner functions.- Specified by:
getSpannerTemplate
in interfaceSpannerRepository<T,
I> - Returns:
- the operations object providing Cloud Spanner functions.
-
performReadOnlyTransaction
Description copied from interface:SpannerRepository
Performs multiple read-only operations in a single transaction.- Specified by:
performReadOnlyTransaction
in 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:SpannerRepository
Performs multiple read and write operations in a single transaction.- Specified by:
performReadWriteTransaction
in 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
-