Skip to content

Commit

Permalink
HHH-15794 NullPointerException when constructing mapping model for ne…
Browse files Browse the repository at this point in the history
…sted embeddables with not optional ManyToOne
  • Loading branch information
dreab8 committed Jan 4, 2023
1 parent 577180b commit f6354ff
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -277,9 +277,10 @@ && equal( join.getKey(), manyToOne ) ) {
else {
final String targetTableName = MappingModelCreationHelper.getTableIdentifierExpression( manyToOne.getTable(), declaringEntityPersister.getFactory() );
if ( CollectionPart.Nature.fromNameExact( navigableRole.getParent().getLocalName() ) != null ) {
final PluralAttributeMapping pluralAttribute = (PluralAttributeMapping) declaringEntityPersister.resolveSubPart(
navigableRole.getParent().getParent()
);
final PluralAttributeMapping pluralAttribute = (PluralAttributeMapping) declaringEntityPersister.findByPath(
navigableRole.getParent().getParent().getFullPath().substring( declaringEntityPersister.getNavigableRole().getFullPath().length() + 1 ) );
assert pluralAttribute != null;

final QueryableCollection persister = (QueryableCollection) pluralAttribute.getCollectionDescriptor();
isKeyTableNullable = !persister.getTableName().equals( targetTableName );
}
Expand Down

0 comments on commit f6354ff

Please sign in to comment.