junction front - back

This commit is contained in:
2024-04-15 23:35:05 +02:00
parent eacdf8d47a
commit 63d0087d0c
9 changed files with 176 additions and 68 deletions

View File

@ -1,6 +1,8 @@
package ovh.herisson.Clyde.Repositories.ScientificPublications;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.ScientificPublications.Research;
import ovh.herisson.Clyde.Tables.ScientificPublications.Researcher;
import ovh.herisson.Clyde.Tables.User;
@ -8,4 +10,7 @@ public interface ResearcherRepository extends CrudRepository<Researcher,Long> {
Researcher findByUser(User user);
Researcher findById(long id);
@Query("select r from Research r where r.author = ?1")
Iterable<Research> findAllByAuthorId(Researcher author);
}

View File

@ -11,7 +11,7 @@ public interface StatsRepository extends CrudRepository<Research,Long> {
@Query("select new map(to_char(r.releaseDate, 'month') as label, sum(r.views) as y) from Research r group by to_char(r.releaseDate, 'month')")
Iterable<Map<String ,Integer>> viewsByMonths();
/**
Iterable<Map<String ,Integer>> viewsByYears();
Iterable<Map<String ,Integer>> viewsByTopics();
Iterable<Map<String ,Integer>> coAuthorByMonths();
@ -22,6 +22,6 @@ public interface StatsRepository extends CrudRepository<Research,Long> {
Iterable<Map<String ,Integer>> researchesByYears();
Iterable<Map<String ,Integer>> researchesByTopics();
Iterable<Map<String ,Integer>> researchesByMonth();
**/
}