Class SimpleDatastoreRepository<T,I>

java.lang.Object
com.google.cloud.spring.data.datastore.repository.support.SimpleDatastoreRepository<T,I>
Type Parameters:
T - the type of the entities
I - the id type of the entities
All Implemented Interfaces:
DatastoreRepository<T,I>, org.springframework.data.repository.CrudRepository<T,I>, org.springframework.data.repository.PagingAndSortingRepository<T,I>, org.springframework.data.repository.query.QueryByExampleExecutor<T>, org.springframework.data.repository.Repository<T,I>

public class SimpleDatastoreRepository<T,I> extends Object implements DatastoreRepository<T,I>
Implementation of DatastoreRepository.
Since:
1.1
  • Constructor Details

  • Method Details

    • performTransaction

      public <A> A performTransaction(Function<DatastoreRepository<T,I>,A> operations)
      Description copied from interface: DatastoreRepository
      Performs multiple read and write operations in a single transaction.
      Specified by:
      performTransaction in interface DatastoreRepository<T,I>
      Type Parameters:
      A - the final return type of the operations.
      Parameters:
      operations - the function representing the operations to perform using a DatastoreRepository based on a single transaction.
      Returns:
      the final result of the transaction.
    • findAll

      public Iterable<T> findAll(org.springframework.data.domain.Sort sort)
      Specified by:
      findAll in interface org.springframework.data.repository.PagingAndSortingRepository<T,I>
    • findAll

      public org.springframework.data.domain.Page<T> findAll(org.springframework.data.domain.Pageable pageable)
      Specified by:
      findAll in interface org.springframework.data.repository.PagingAndSortingRepository<T,I>
    • save

      public <S extends T> S save(S entity)
      Specified by:
      save in interface org.springframework.data.repository.CrudRepository<T,I>
    • saveAll

      public <S extends T> Iterable<S> saveAll(Iterable<S> entities)
      Specified by:
      saveAll in interface org.springframework.data.repository.CrudRepository<T,I>
    • findById

      public Optional<T> findById(I id)
      Specified by:
      findById in interface org.springframework.data.repository.CrudRepository<T,I>
    • existsById

      public boolean existsById(I id)
      Specified by:
      existsById in interface org.springframework.data.repository.CrudRepository<T,I>
    • findAll

      public Iterable<T> findAll()
      Specified by:
      findAll in interface org.springframework.data.repository.CrudRepository<T,I>
    • findAllById

      public Iterable<T> findAllById(Iterable<I> ids)
      Specified by:
      findAllById in interface org.springframework.data.repository.CrudRepository<T,I>
    • count

      public long count()
      Specified by:
      count in interface org.springframework.data.repository.CrudRepository<T,I>
    • deleteById

      public void deleteById(I id)
      Specified by:
      deleteById in interface org.springframework.data.repository.CrudRepository<T,I>
    • delete

      public void delete(T entity)
      Specified by:
      delete in interface org.springframework.data.repository.CrudRepository<T,I>
    • deleteAll

      public void deleteAll(Iterable<? extends T> entities)
      Specified by:
      deleteAll in interface org.springframework.data.repository.CrudRepository<T,I>
    • deleteAll

      public void deleteAll()
      Specified by:
      deleteAll in interface org.springframework.data.repository.CrudRepository<T,I>
    • findOne

      public <S extends T> Optional<S> findOne(org.springframework.data.domain.Example<S> example)
      Specified by:
      findOne in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
    • findAll

      public <S extends T> Iterable<S> findAll(org.springframework.data.domain.Example<S> example)
      Specified by:
      findAll in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
    • findAll

      public <S extends T> Iterable<S> findAll(org.springframework.data.domain.Example<S> example, org.springframework.data.domain.Sort sort)
      Specified by:
      findAll in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
    • findAll

      public <S extends T> org.springframework.data.domain.Page<S> findAll(org.springframework.data.domain.Example<S> example, org.springframework.data.domain.Pageable pageable)
      Specified by:
      findAll in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
    • count

      public <S extends T> long count(org.springframework.data.domain.Example<S> example)
      Specified by:
      count in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
    • exists

      public <S extends T> boolean exists(org.springframework.data.domain.Example<S> example)
      Specified by:
      exists in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
    • deleteAllById

      public void deleteAllById(Iterable<? extends I> iterable)
      Specified by:
      deleteAllById in interface org.springframework.data.repository.CrudRepository<T,I>
    • findBy

      public <S extends T, R> R findBy(org.springframework.data.domain.Example<S> example, Function<org.springframework.data.repository.query.FluentQuery.FetchableFluentQuery<S>,R> queryFunction)
      Specified by:
      findBy in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>