From 75dc1138dec88e8026381dee65e9582e053af809 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Wed, 18 Sep 2013 08:10:08 -0500 Subject: [PATCH] HHH-8514 - EntityManager#createQuery(CriteriaQuery) should throw IAE rather than ISE --- .../hibernate/jpa/criteria/compile/CriteriaCompiler.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hibernate-entitymanager/src/main/java/org/hibernate/jpa/criteria/compile/CriteriaCompiler.java b/hibernate-entitymanager/src/main/java/org/hibernate/jpa/criteria/compile/CriteriaCompiler.java index 493d06c0d8..6c21243538 100644 --- a/hibernate-entitymanager/src/main/java/org/hibernate/jpa/criteria/compile/CriteriaCompiler.java +++ b/hibernate-entitymanager/src/main/java/org/hibernate/jpa/criteria/compile/CriteriaCompiler.java @@ -54,7 +54,12 @@ public class CriteriaCompiler implements Serializable { } public Query compile(CompilableCriteria criteria) { - criteria.validate(); + try { + criteria.validate(); + } + catch (IllegalStateException ise) { + throw new IllegalArgumentException( "Error occurred validating the Criteria", ise ); + } final Map, ExplicitParameterInfo> explicitParameterInfoMap = new HashMap, ExplicitParameterInfo>();