NPE in AbstractPropertyMapping.getCommonPersistentClass when creating UnionSubclassEntityPersister for dynamic-map

Description

I use some entities of dynamic-map mode in program.
After upgrading hibernate from 5.2.13 to 5.2.14 / 5.2.15 / 5.2.16 / 5.2.17, an NPE occurs while creating SessionFactory:

The HBM file to reproduce the error:

Environment

None

Activity

Show:
Andrea Boriero
May 4, 2018, 10:50 AM

Hi ,
can you please provide a failing test case? It would help us a lot.
You can find test templates at: https://github.com/hibernate/hibernate-test-case-templates/tree/master/orm/hibernate-orm-5.

Thanks

凯斌黄
May 8, 2018, 4:13 AM

Hi Andrea Boriero,
The test case link: https://github.com/unrealt/hibernate-test-case-templates

Thanks

凯斌黄
May 8, 2018, 4:21 AM

The AbstractPropertyMapping source code:

In my case, the entities are dynamic-map. So when it calls 'clazz2.getMappedClass()', a null returned.

Andrea Boriero
May 8, 2018, 12:53 PM

Hi ,

thanks for the test.

Assignee

Andrea Boriero

Reporter

凯斌黄

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.2.13

Components

Affects versions

Priority

Major
Configure