HHH-15354 Throw MappingException instead of NPE for hbm referencing unmapped class

This commit is contained in:
Andrea Boriero 2022-06-23 14:11:44 +02:00 committed by Andrea Boriero
parent 48e3bf8381
commit a8318fdfb9
1 changed files with 3 additions and 0 deletions

View File

@ -165,6 +165,9 @@ public abstract class ToOne extends SimpleValue implements Fetchable, SortableVa
@Override
public int[] sortProperties() {
final PersistentClass entityBinding = getMetadata().getEntityBinding( getReferencedEntityName() );
if ( entityBinding == null ) {
return null;
}
final Value value;
if ( getReferencedPropertyName() == null ) {
value = entityBinding.getIdentifier();