Interface SpannerRepository<T,I>

Type Parameters:
T - the entity type of the repository
I - 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 Type
    Method
    Description
    Gets a SpannerOperations, which allows more-direct access to Google Cloud Spanner functions.
    <A> A
    Performs multiple read-only operations in a single transaction.
    <A> A
    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 a SpannerOperations, 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.