From 0810bc0c4a072a8f0ea0f0a0253e837543050150 Mon Sep 17 00:00:00 2001 From: Tom Vahlman <tom@dsv.su.se> Date: Sat, 14 Apr 2012 11:33:59 +0200 Subject: [PATCH] The sorting SQL:s now returns the same number of employees when sorting on keyword as returned when sorting on last name. --- .../java/se/su/dsv/scipro/springdata/repos/SupervisorRepo.java | 1 - .../scipro/springdata/serviceimpls/SupervisorServiceImpl.java | 1 - src/test/java/se/su/dsv/scipro/springdata/TestSupervisor.java | 2 ++ 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/se/su/dsv/scipro/springdata/repos/SupervisorRepo.java b/src/main/java/se/su/dsv/scipro/springdata/repos/SupervisorRepo.java index 290de712e8..0abdbbfb01 100644 --- a/src/main/java/se/su/dsv/scipro/springdata/repos/SupervisorRepo.java +++ b/src/main/java/se/su/dsv/scipro/springdata/repos/SupervisorRepo.java @@ -1,6 +1,5 @@ package se.su.dsv.scipro.springdata.repos; -import org.springframework.data.domain.Sort.Direction; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.querydsl.QueryDslPredicateExecutor; diff --git a/src/main/java/se/su/dsv/scipro/springdata/serviceimpls/SupervisorServiceImpl.java b/src/main/java/se/su/dsv/scipro/springdata/serviceimpls/SupervisorServiceImpl.java index fa721fbc76..8e7f31d9af 100644 --- a/src/main/java/se/su/dsv/scipro/springdata/serviceimpls/SupervisorServiceImpl.java +++ b/src/main/java/se/su/dsv/scipro/springdata/serviceimpls/SupervisorServiceImpl.java @@ -2,7 +2,6 @@ package se.su.dsv.scipro.springdata.serviceimpls; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import se.su.dsv.scipro.data.dataobjects.Employee; diff --git a/src/test/java/se/su/dsv/scipro/springdata/TestSupervisor.java b/src/test/java/se/su/dsv/scipro/springdata/TestSupervisor.java index b5a9e7a842..446aaba7c4 100644 --- a/src/test/java/se/su/dsv/scipro/springdata/TestSupervisor.java +++ b/src/test/java/se/su/dsv/scipro/springdata/TestSupervisor.java @@ -190,6 +190,8 @@ public class TestSupervisor { @Test @Transactional @Rollback + /* this test is inadequate for determining that sorting with order by really works in JPQL, it is necessary to create "many" employees which each have many keywords of + * both type Word and of type Area in the same test to determine if the JPQL#orderBy sorts correctly */ public void testFindSupervisorsOrderedByNumKeywordsDescending() { Employee tholerus = getEmployee("Torgny", "Tholerus", "torgny@dsv.su.se"); Employee vahlman = getEmployee("Tom", "Vahlman", "tom@dsv.su.se");