Interface DatasetRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Dataset,UUID>, org.springframework.data.jpa.repository.JpaRepository<Dataset,UUID>, org.springframework.data.repository.ListCrudRepository<Dataset,UUID>, org.springframework.data.repository.ListPagingAndSortingRepository<Dataset,UUID>, org.springframework.data.repository.PagingAndSortingRepository<Dataset,UUID>, org.springframework.data.repository.query.QueryByExampleExecutor<Dataset>, org.springframework.data.repository.Repository<Dataset,UUID>

public interface DatasetRepository extends org.springframework.data.jpa.repository.JpaRepository<Dataset,UUID>
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Loads a dataset while acquiring a pessimistic write lock on its row.
     
    Locking lookup by name; equivalent to findByIdForUpdate(java.util.UUID) but resolved in a single round trip when the caller only has the dataset name.

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findByName

      Optional<Dataset> findByName(String name)
    • existsByName

      boolean existsByName(String name)
    • findByIdForUpdate

      @Lock(PESSIMISTIC_WRITE) @Query("select d from Dataset d where d.id = :id") Optional<Dataset> findByIdForUpdate(@Param("id") UUID id)
      Loads a dataset while acquiring a pessimistic write lock on its row. Used to serialize new version creation so the next = max(version) + 1 computation cannot race two callers onto the same version number. The (dataset_id, version) unique constraint is the backstop if the lock is bypassed.
    • findByNameForUpdate

      @Lock(PESSIMISTIC_WRITE) @Query("select d from Dataset d where d.name = :name") Optional<Dataset> findByNameForUpdate(@Param("name") String name)
      Locking lookup by name; equivalent to findByIdForUpdate(java.util.UUID) but resolved in a single round trip when the caller only has the dataset name. Used by version creation so the pessimistic write lock is acquired atomically with the lookup.