From 70705f3e96dcc97e460660316467b1c04f85324d Mon Sep 17 00:00:00 2001 From: Gavin King Date: Sun, 11 Feb 2024 17:16:54 +0100 Subject: [PATCH] HHH-17729 move validation of constructors in HQL instantiations to SemanticQueryBuilder fix test --- .../InstantiationWithMultiplePrimitiveConstructorsTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/instantiation/InstantiationWithMultiplePrimitiveConstructorsTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/instantiation/InstantiationWithMultiplePrimitiveConstructorsTest.java index 015a6eb2e9..5380d79d0f 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/instantiation/InstantiationWithMultiplePrimitiveConstructorsTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/instantiation/InstantiationWithMultiplePrimitiveConstructorsTest.java @@ -7,7 +7,7 @@ package org.hibernate.orm.test.query.hql.instantiation; import org.hibernate.annotations.Imported; -import org.hibernate.query.sqm.sql.internal.InstantiationException; +import org.hibernate.query.SemanticException; import org.hibernate.testing.orm.junit.DomainModel; import org.hibernate.testing.orm.junit.Jira; @@ -86,8 +86,7 @@ public class InstantiationWithMultiplePrimitiveConstructorsTest { fail( "Long assignment to int should not be allowed" ); } catch (Exception e) { - assertThat( e ).isInstanceOf( InstantiationException.class ); - assertThat( e.getMessage() ).contains( "Cannot set field 'value'" ); + assertThat( e.getCause() ).isInstanceOf( SemanticException.class ); } } ); }