diff --git a/framework/src/play/db/jpa/JPQL.java b/framework/src/play/db/jpa/JPQL.java index 7f61b9ec30..73054354ea 100644 --- a/framework/src/play/db/jpa/JPQL.java +++ b/framework/src/play/db/jpa/JPQL.java @@ -248,11 +248,7 @@ public String findByToJPQL(String findBy) { public String findByToJPQL(String dbName, String findBy) { findBy = findBy.substring(2); StringBuilder jpql = new StringBuilder(); - String subRequest; - if (findBy.contains("OrderBy")) - subRequest = findBy.split("OrderBy")[0]; - else subRequest = findBy; - String[] parts = subRequest.split("And"); + String[] parts = findBy.split("And"); int index = 1; for (int i = 0; i < parts.length; i++) { String part = parts[i];