Try to replicate it with this test case:
http://in.relation.to/2018/06/04/best-way-write-hibernate-orm-issue-test-case/
It's not clear what's not working.