The test case attached.
We have faced with the problem on more complex selects, but the test case contains the simplest one.
So select like:
produces the following SQL:
For main entity it generates a proper join* subs3_* but for joined testentity1_ the join was not generated but appropriate records into select are added:
As a result it fails with:
The subs are mapped over @OneToMany annotation.
Can you try 5.2.6? I have fixed something similar for and I think your issue should be resolved now.
Just tested against master and 5.2.6, the proper SQL is generated: