DATAJPA-14 - Added query validation for String based JPA query.

Simply let the EntityManager create a JPA query object on SimpleJpaQuery creation. This fails if the query contains syntactical errors.
This commit is contained in:
Oliver Gierke
2011-03-03 22:02:43 +01:00
parent 674e12d631
commit 1ffd4390cd

View File

@@ -59,6 +59,9 @@ final class SimpleJpaQuery extends AbstractStringBasedJpaQuery {
method.getCountQuery() == null ? QueryUtils
.createCountQueryFor(queryString) : method
.getCountQuery();
// Try to create a
em.createQuery(queryString);
}