Note that your test case is kind of broken, as you rely on fetching the entity from the first level cache i.e. persistence context and it would fail if the entity were not contained there. Try clearing the entity manager after flushing to see the test case fail even on 5. We will clarify the requirements for native queries that want to materialize entities as part of https://github.com/hibernate/hibernate-orm/pull/6194 |