Fixed and moved MappedSuperclassInheritanceTest to orm.test

Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
Jan Schatteman 2021-12-22 18:06:13 +01:00 committed by Christian Beikov
parent 90e551da4b
commit 195df69019
3 changed files with 6 additions and 6 deletions

View File

@ -1481,9 +1481,9 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> 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 );

View File

@ -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

View File

@ -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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
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());
}
} );
}