Package io.ran

Class CrudRepositoryTestDoubleBase<T,K>

java.lang.Object
io.ran.CrudRepositoryTestDoubleBase<T,K>
All Implemented Interfaces:
CrudRepository<T,K>

public abstract class CrudRepositoryTestDoubleBase<T,K> extends Object implements CrudRepository<T,K>
  • Field Details

  • Constructor Details

  • Method Details

    • get

      public Optional<T> get(K k)
      Description copied from interface: CrudRepository
      Get an instance of the entity by its id (primary key).

      Note: If the entity does not have a primary key, this method will not be available.

      In case of compound primary key, pass the model object with the primary key fields populated.

      Specified by:
      get in interface CrudRepository<T,K>
      Parameters:
      k - the id of the entity
      Returns:
      an optional containing the entity if it exists
    • getAll

      public Stream<T> getAll()
      Description copied from interface: CrudRepository
      Get all instances of the entity, as a stream.
      Specified by:
      getAll in interface CrudRepository<T,K>
      Returns:
      an unordered stream of all instances of the entity
    • deleteById

      public CrudRepository.CrudUpdateResult deleteById(K k)
      Description copied from interface: CrudRepository
      Delete an instance of the entity by its id (primary key).

      Note: If the entity does not have a primary key, this method will not be available.

      In case of compound primary key, pass the model object with the primary key fields populated.

      Specified by:
      deleteById in interface CrudRepository<T,K>
      Parameters:
      k - the id of the entity to be deleted
      Returns:
      the result of the delete operation
    • deleteByIds

      public CrudRepository.CrudUpdateResult deleteByIds(Collection<K> k)
      Description copied from interface: CrudRepository
      Delete all instances of the entity which has an id (primary key) in the given collection.

      Note: If the entity does not have a primary key, this method will not be available.

      In case of compound primary key, pass the model object with the primary key fields populated.

      Specified by:
      deleteByIds in interface CrudRepository<T,K>
      Parameters:
      k - a collection of ids to be deleted
      Returns:
      the result of the delete operation
    • save

      Description copied from interface: CrudRepository
      Insert a new instance of the entity or update an existing one. Will match by primary key, but not other unique keys.
      Specified by:
      save in interface CrudRepository<T,K>
      Parameters:
      t - the entity to save
      Returns:
      the result of the save operation
    • save

      protected <Z> CrudRepository.CrudUpdateResult save(Z t, Class<Z> zClass)