Package dev.vernite.vernite.project
Interface ProjectRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Project,
,Long> NotFoundRepository<Project,
,Long> org.springframework.data.repository.Repository<Project,
,Long> SoftDeleteRepository<Project,
Long>
CRUD repository for project entity.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Project
findByIdAndMemberOrThrow
(long id, User user) Finds active project by id and checks if user is member of project.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 dev.vernite.vernite.utils.SoftDeleteRepository
findByIdAndActiveNull, findByIdOrThrow
-
Method Details
-
findByIdAndMemberOrThrow
Finds active project by id and checks if user is member of project.- Parameters:
id
- project iduser
- potential project member- Returns:
- project with given id and user is its member
- Throws:
EntityNotFoundException
- thrown when project is not found or user is not member of found project
-