The sorting SQL:s now returns the same number of employees when sorting on keyword as returned when sorting on last name.

This commit is contained in:
Tom Vahlman 2012-04-14 11:33:59 +02:00
parent 439c6d7774
commit 0810bc0c4a
3 changed files with 2 additions and 2 deletions
src
main/java/se/su/dsv/scipro/springdata
test/java/se/su/dsv/scipro/springdata

@ -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;

@ -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;

@ -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");