diff --git a/src/main/java/se/su/dsv/scipro/match/dao/jpa/KeywordDaoJPAImp.java b/src/main/java/se/su/dsv/scipro/match/dao/jpa/KeywordDaoJPAImp.java index 9b4860b570..1f6914edb7 100644 --- a/src/main/java/se/su/dsv/scipro/match/dao/jpa/KeywordDaoJPAImp.java +++ b/src/main/java/se/su/dsv/scipro/match/dao/jpa/KeywordDaoJPAImp.java @@ -94,9 +94,9 @@ public class KeywordDaoJPAImp extends LazyDeleteAbstractDaoJPAImp<Keyword> imple public List<Keyword> doInJpa(EntityManager em) throws PersistenceException { TypedQuery<Keyword> query; if(includeLazyDeleted) - query = em.createQuery("SELECT x FROM "+domainClassString+" x WHERE x.type = :type", domainClass); + query = em.createQuery("SELECT x FROM "+domainClassString+" x WHERE x.type = :type ORDER BY keyword", domainClass); else - query = em.createQuery("SELECT x FROM "+domainClassString+" x WHERE x.type = :type AND x.deleted = false", domainClass); + query = em.createQuery("SELECT x FROM "+domainClassString+" x WHERE x.type = :type AND x.deleted = false ORDER BY keyword", domainClass); query.setParameter("type", keywordType); query.setHint(QueryHints.HINT_CACHEABLE, "true"); return query.getResultList();