Eager-Loading of SortedSet in 1:n bidirectional Entities fails with NPE

Description

Create two Entities: Book and Article

Book contains SortedSet of Articles, sorted by number of pages
Use @SortNatural and let Article implement Comparable
EagerLoading=true

Article has association to Book
EagerLoading=true

Try to fetch via JPQL all articles, see Testcases attached

Testcase "getArticleWithJoinFetch" is valid
"SELECT DISTINCT a FROM Article a LEFT JOIN FETCH a.book"
LInk to Book is PREFETCHED with JOIN FETCH

Testcase "getArticleWithEagerLoadingWithoutJoinFetch" fails
"SELECT DISTINCT a FROM Article a"
Eager-Loading fetchtes Book, then tries to fetch Articels
NPE is thrown while compareTo (from Comparable) is trying to sort the articles.
Articles are not initialized when getting compared
Could be a problem with the PersistentSortedSet Implementation

Environment

None

Assignee

Gail Badner

Reporter

Thorsten Falk

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure