Advertisement
Guest User

TolinRepository

a guest
Sep 16th, 2019
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1.  
  2. package repositories;
  3.  
  4. import java.util.List;
  5.  
  6. import org.springframework.data.jpa.repository.JpaRepository;
  7. import org.springframework.data.jpa.repository.Query;
  8. import org.springframework.stereotype.Repository;
  9.  
  10. import domain.Golub;
  11.  
  12. @Repository
  13. public interface GolubRepository extends JpaRepository<Golub, Integer> {
  14.  
  15. @Query("select g from Golub g where g.conference.id = ?1")
  16. List<Golub> findGolubByConference(int conferenceId);
  17.  
  18. @Query("select g from Golub g where g.administrator.id = ?1")
  19. List<Golub> findGolubByAdministrator(int administratorId);
  20.  
  21. @Query("select avg(1.0*(select count(g) from Golub g where g.conference.id=c.id)), stddev(1.0*(select count(g) from Golub g where g.conference.id=c.id)) from Conference c")
  22. Double[] getGolubsPerConferenceStats();
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement