T
- the entity type of the repositoryI
- the id type of the entitypublic class SimpleSpannerRepository<T,I> extends Object implements SpannerRepository<T,I>
Constructor and Description |
---|
SimpleSpannerRepository(SpannerTemplate spannerTemplate,
Class<T> entityType) |
Modifier and Type | Method and Description |
---|---|
long |
count() |
void |
delete(Object entity) |
void |
deleteAll() |
void |
deleteAll(Iterable<? extends T> entities) |
void |
deleteAllById(Iterable<? extends I> ids) |
void |
deleteById(Object id) |
boolean |
existsById(I id) |
Iterable<T> |
findAll() |
org.springframework.data.domain.Page<T> |
findAll(org.springframework.data.domain.Pageable pageable) |
Iterable<T> |
findAll(org.springframework.data.domain.Sort sort) |
Iterable<T> |
findAllById(Iterable<I> ids) |
Optional<T> |
findById(I id) |
SpannerOperations |
getSpannerTemplate()
Gets a
SpannerOperations , 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> |
save(S entity) |
<S extends T> |
saveAll(Iterable<S> entities) |
public SimpleSpannerRepository(SpannerTemplate spannerTemplate, Class<T> entityType)
public SpannerOperations getSpannerTemplate()
SpannerRepository
SpannerOperations
, which allows more-direct access to Google Cloud Spanner
functions.getSpannerTemplate
in interface SpannerRepository<T,I>
public <A> A performReadOnlyTransaction(Function<SpannerRepository<T,I>,A> operations)
SpannerRepository
performReadOnlyTransaction
in interface SpannerRepository<T,I>
A
- the final return type of the operations.operations
- the function representing the operations to perform using a SpannerRepository
based on a single transaction.public <A> A performReadWriteTransaction(Function<SpannerRepository<T,I>,A> operations)
SpannerRepository
performReadWriteTransaction
in interface SpannerRepository<T,I>
A
- the final return type of the operations.operations
- the function representing the operations to perform using a SpannerRepository
based on a single transaction.public <S extends T> S save(S entity)
public boolean existsById(I id)
public long count()
public void deleteById(Object id)
public void delete(Object entity)
public void deleteAll()
public org.springframework.data.domain.Page<T> findAll(org.springframework.data.domain.Pageable pageable)
Copyright © 2022. All rights reserved.