Statistics.getCollectionRoleNames() reports incorrect value

Description

Statistics:getCollectionRoleNames() returns an incorrect value because it uses MetamodelImpl:getAllCollectionRoles() that uses the "entityPersisterMap" attribute instead of "collectionPersisterMap".

The fix is quite simple: use the correct attribute in that getter.

I met this issue with Hibernate 5.2.12 and still saw it in the 5.2.17 and current (2018/08/13) master sources.

I will submit a PR for master. But it should be applied to other branches as well.

Note that this is my first Hibernate contribution, I'm not familiar with the process yet.

Activity

Show:

Florian Beaufumé August 13, 2018 at 9:55 AM

For those who do not have the fix yet, here is a work around I use instead of "stats.getCollectionRoleNames()":
((MetamodelImplementor) sessionFactory.getMetamodel()).collectionPersisters().keySet()

Fixed

Details

Assignee

Reporter

Components

Affects versions

Priority

Created August 13, 2018 at 9:03 AM
Updated August 14, 2018 at 12:24 PM
Resolved August 13, 2018 at 10:10 AM