@Override
public Query visitNamedQuery(@NotNull String queryName) {
try {
return entityManager.createNamedQuery(queryName);
} catch (final IllegalArgumentException e) {
throw new SpecificationViolationException("No named query '" + queryName + "' found.", method);
}
}
@Override
public Query visitQuery(@NotNull String query) {
try {
return entityManager.createQuery(query);
} catch (final IllegalArgumentException e) {
throw new SpecificationViolationException("Invalid query: " + query, method, e);
}
}
@Override
public Query visitSQLNamedQuery(@NotNull String queryName) {
try {
return entityManager.createNamedQuery(queryName);
} catch (final IllegalArgumentException e) {
throw new SpecificationViolationException("No named query '" + queryName + "' found.", method);
}
}
@Override
public Query visitSQLQuery(@NotNull String query) {
try {
return entityManager.createNativeQuery(query);
} catch (final IllegalArgumentException e) {
throw new SpecificationViolationException("Invalid query: " + query, method, e);
}
}
});
int ordinalTmp = 0;