improve exception message

This commit is contained in:
Gavin 2023-05-09 19:50:20 +02:00 committed by Gavin King
parent 6a72952057
commit 3da745e62b
2 changed files with 2 additions and 2 deletions

View File

@ -333,7 +333,7 @@ public class InFlightMetadataCollectorImpl implements InFlightMetadataCollector,
if ( matchingPersistentClass != null ) {
throw new DuplicateMappingException(
String.format(
"The [%s] and [%s] entities share the same JPA entity name: [%s], which is not allowed",
"Entity classes [%s] and [%s] share the entity name '%s' (entity names must be distinct)",
matchingPersistentClass.getClassName(),
persistentClass.getClassName(),
jpaEntityName

View File

@ -39,7 +39,7 @@ public class DuplicateEntityNameTest extends BaseCoreFunctionalTestCase {
fail("Should throw DuplicateMappingException");
}
catch (DuplicateMappingException e) {
assertEquals( "The [org.hibernate.orm.test.entityname.DuplicateEntityNameTest$Purchase1] and [org.hibernate.orm.test.entityname.DuplicateEntityNameTest$Purchase2] entities share the same JPA entity name: [Purchase], which is not allowed", e.getMessage() );
assertEquals( "Entity classes [org.hibernate.orm.test.entityname.DuplicateEntityNameTest$Purchase1] and [org.hibernate.orm.test.entityname.DuplicateEntityNameTest$Purchase2] share the entity name 'Purchase' (entity names must be distinct)", e.getMessage() );
}
}