SortedMap defined in .hbm.xml are not sortable

Description

I have old .hbm.xml files with a map defined <map name="traductions" sort="natural" >. The POJO has a SortedMap. It works great with Hibernate 4.3.10.Final.

When I migrate to Hibernate 5.1.0.Final, it doesn't work anymore. I trace the problem in PluralAttributeSourceMapImpl that doesn't implements org.hibernate.boot.model.source.spi.Sortable. The only class that implements Sortable is PluralAttributeSourceSetImpl. So I guess SortedSet are managed, but not SortedMap.

Environment

None

Activity

Show:
Adrien
May 27, 2016, 8:09 AM

https://github.com/hibernate/hibernate-test-case-templates/pull/7
Here is a test for HHH-10774. There is the same test in both test-case-template-hibernate-orm4 and test-case-template-hibernate-orm5 with a SortedMap. It works on hibernate4. It doesn't on hibernate5 without the PluralAttributeSourceMapImpl patch.

Adrien
May 30, 2016, 7:18 AM

I just add the test case as a zip.

Steve Ebersole
June 19, 2016, 4:38 PM

Silly error on my part

Thanks!

Steve Ebersole
June 19, 2016, 4:45 PM

I am missing how the attached test illustrates the problem though.

Adrien
June 20, 2016, 6:40 AM

> I am missing how the attached test illustrates the problem though.
If you remove the PluralAttributeSourceSetImpl file in the Hibernate 5 version, the test should fail. But the same code work with Hibernate 4.

Assignee

Steve Ebersole

Reporter

Adrien

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure