I just tried out the attached example and I can confirm that the stack overflow still occurs in hibernate 5.