diff --git a/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java b/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java index eb2d686738..0a46513d65 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java @@ -1481,9 +1481,9 @@ public class SemanticQueryBuilder extends HqlParserBaseVisitor implem ); return correlation.getCorrelatedRoot(); } - throw new IllegalArgumentException( "Could not resolve entity reference or correlation path: " + name ); + throw new SemanticException( "Could not resolve entity reference or correlation path: " + name ); } - throw new IllegalArgumentException( "Could not resolve entity reference: " + name ); + throw new SemanticException( "Could not resolve entity reference: " + name ); } checkFQNEntityNameJpaComplianceViolationIfNeeded( name, entityDescriptor ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/ConfigurationTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/ConfigurationTest.java index ed374b55ff..5fde12928c 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/ConfigurationTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/ConfigurationTest.java @@ -15,7 +15,7 @@ import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.engine.spi.SessionFactoryImplementor; -import org.hibernate.query.sqm.InterpretationException; +import org.hibernate.query.SemanticException; import org.hibernate.test.annotations.Boat; import org.hibernate.test.annotations.Ferry; @@ -68,7 +68,7 @@ public class ConfigurationTest { fail( "Boat should not be mapped" ); } catch (IllegalArgumentException expected) { - assertEquals( InterpretationException.class, expected.getCause().getClass() ); + assertEquals( SemanticException.class, expected.getCause().getClass() ); // expected outcome // see org.hibernate.test.jpa.compliance.tck2_2.QueryApiTest#testInvalidQueryMarksTxnForRollback diff --git a/hibernate-core/src/test/java/org/hibernate/test/inheritance/MappedSuperclassInheritanceTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/inheritance/MappedSuperclassInheritanceTest.java similarity index 95% rename from hibernate-core/src/test/java/org/hibernate/test/inheritance/MappedSuperclassInheritanceTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/inheritance/MappedSuperclassInheritanceTest.java index b1a59b5ab1..c562c898ad 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/inheritance/MappedSuperclassInheritanceTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/inheritance/MappedSuperclassInheritanceTest.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.test.inheritance; +package org.hibernate.orm.test.inheritance; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -76,7 +76,7 @@ public class MappedSuperclassInheritanceTest extends BaseEntityManagerFunctional fail(); } catch (Exception expected) { SemanticException rootException = (SemanticException) ExceptionUtil.rootCause( expected); - assertEquals("Employee is not mapped", rootException.getMessage()); + assertEquals("Could not resolve entity reference: Employee", rootException.getMessage()); } } ); }