diff --git a/src/docbkx/reference/jpa.xml b/src/docbkx/reference/jpa.xml
index 5d1988cc1..2569e9280 100644
--- a/src/docbkx/reference/jpa.xml
+++ b/src/docbkx/reference/jpa.xml
@@ -179,7 +179,7 @@
findByAgeOrderByLastnameDesc
- … where x.age > ?1 order by x.lastname
+ … where x.age = ?1 order by x.lastname
desc
diff --git a/src/main/java/org/springframework/data/jpa/repository/query/JpaCountQueryCreator.java b/src/main/java/org/springframework/data/jpa/repository/query/JpaCountQueryCreator.java
index eae9b6415..9ab545177 100644
--- a/src/main/java/org/springframework/data/jpa/repository/query/JpaCountQueryCreator.java
+++ b/src/main/java/org/springframework/data/jpa/repository/query/JpaCountQueryCreator.java
@@ -19,9 +19,10 @@ import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
import org.springframework.data.domain.Sort;
-import org.springframework.data.repository.query.SimpleParameterAccessor;
+import org.springframework.data.repository.query.ParameterAccessor;
import org.springframework.data.repository.query.parser.PartTree;
@@ -32,9 +33,6 @@ import org.springframework.data.repository.query.parser.PartTree;
*/
public class JpaCountQueryCreator extends JpaQueryCreator {
- private final Class> domainClass;
-
-
/**
* Creates a new {@link JpaCountQueryCreator}.
*
@@ -43,12 +41,10 @@ public class JpaCountQueryCreator extends JpaQueryCreator {
* @param domainClass
* @param em
*/
- public JpaCountQueryCreator(PartTree tree,
- SimpleParameterAccessor parameters, Class> domainClass,
- EntityManager em) {
+ public JpaCountQueryCreator(PartTree tree, ParameterAccessor parameters,
+ Class> domainClass, EntityManager em) {
super(tree, parameters, domainClass, em);
- this.domainClass = domainClass;
}
@@ -56,16 +52,17 @@ public class JpaCountQueryCreator extends JpaQueryCreator {
* (non-Javadoc)
*
* @see
- * org.springframework.data.jpa.repository.query.JpaQueryCreator#finalize
+ * org.springframework.data.jpa.repository.query.JpaQueryCreator#complete
* (javax.persistence.criteria.Predicate,
* org.springframework.data.domain.Sort,
* javax.persistence.criteria.CriteriaQuery,
- * javax.persistence.criteria.CriteriaBuilder)
+ * javax.persistence.criteria.CriteriaBuilder,
+ * javax.persistence.criteria.Root)
*/
@Override
protected CriteriaQuery