HHH-8514 - EntityManager#createQuery(CriteriaQuery) should throw IAE rather than ISE

This commit is contained in:
Steve Ebersole 2013-09-18 08:10:08 -05:00
parent 37d2e1804a
commit 75dc1138de
1 changed files with 6 additions and 1 deletions

View File

@ -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<ParameterExpression<?>, ExplicitParameterInfo<?>> explicitParameterInfoMap =
new HashMap<ParameterExpression<?>, ExplicitParameterInfo<?>>();