Assuming the following mapping:
When fetching the Post entity directly:
Hibernate generates the following SQL:
But if we try to execute an HQL query:
We get the expected exception which used to be thrown in Hibernate 4.x.
This would most definitely seem to be a regression in behavior
Fixed in master, 5.1, and 5.0 branches.