Interface ProjectSubscriptionRepository
-
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<ProjectSubscription,java.lang.Long>
,IridaJpaRepository<ProjectSubscription,java.lang.Long>
,org.springframework.data.jpa.repository.JpaSpecificationExecutor<ProjectSubscription>
,org.springframework.data.repository.PagingAndSortingRepository<ProjectSubscription,java.lang.Long>
,org.springframework.data.repository.Repository<ProjectSubscription,java.lang.Long>
,org.springframework.data.repository.history.RevisionRepository<ProjectSubscription,java.lang.Long,java.lang.Integer>
public interface ProjectSubscriptionRepository extends IridaJpaRepository<ProjectSubscription,java.lang.Long>
Repository for storing, removing, and retrievingProjectSubscription
s
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.springframework.data.domain.Page<ProjectSubscription>
findAllProjectSubscriptionsByUser(User user, org.springframework.data.domain.Pageable page)
Find all theProjectSubscription
for the given user.ProjectSubscription
findProjectSubscriptionByUserAndProject(User user, Project project)
Find theProjectSubscription
for the given user and project.java.util.List<Project>
getProjectsForUserWithSubscriptions(User user)
java.util.List<User>
getUsersWithSubscriptions()
-
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.jpa.repository.JpaSpecificationExecutor
count, exists, findAll, findAll, findAll, findOne
-
-
-
-
Method Detail
-
findAllProjectSubscriptionsByUser
@Query("from ProjectSubscription ps where ps.user = ?1") org.springframework.data.domain.Page<ProjectSubscription> findAllProjectSubscriptionsByUser(User user, org.springframework.data.domain.Pageable page)
Find all theProjectSubscription
for the given user.- Parameters:
user
- the user associated with project subscriptionspage
- the page request- Returns:
- a page of
ProjectSubscription
.
-
findProjectSubscriptionByUserAndProject
@Query("from ProjectSubscription ps where ps.user = ?1 and ps.project = ?2") ProjectSubscription findProjectSubscriptionByUserAndProject(User user, Project project)
Find theProjectSubscription
for the given user and project.- Parameters:
user
- the the user associated with the project subscriptionproject
- the project associated with the project subscription- Returns:
- a
ProjectSubscription
.
-
getUsersWithSubscriptions
@Query("Select distinct ps.user from ProjectSubscription ps where ps.emailSubscription = true") java.util.List<User> getUsersWithSubscriptions()
- Returns:
- A List of
User
-
getProjectsForUserWithSubscriptions
@Query("Select ps.project from ProjectSubscription ps where ps.user = ?1 and ps.emailSubscription = true") java.util.List<Project> getProjectsForUserWithSubscriptions(User user)
- Parameters:
user
- the user to show project subscriptions for- Returns:
- A List of
Project
s
-
-