I hit this bug recently and can confirm this affects 5.0.12. Attached test case. I worked around the issue by using the EntityType but this works as expected in eclipselink.