Duplicate children in parent java object due to grandchildren

Description

Using spring boot 2.0.4.RELEASE which uses Hibernate 5.2.17.Final the following test fails:

https://github.com/BRNTZN/hibernate_duplication_bug/blob/master/src/test/java/app/DuplicationTest.java
(I created a little test project to showcase the bug)

Eventhough I only added one child to the parent, that child actually appears in the parent's list an equal amount of time as there are grandchildren. 3 in this example.

Further investigating reveals that there are no duplicates in the database, this is purely in the java objects after find. Also changing the List to Set in the parent class "fixes" the problem.

Environment

None

Assignee

Unassigned

Reporter

Brent Courtois

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure