HHH-8683 EntityEntry backport on master

Hey @gunnarmorling and @sanne
I had to make a few adjustments to port it to master, can you double check it.
(new pull request on the correct repo)
That can't be ;) Although a comment on `DefaultEntityEntry` recommending to use JOL when changing the type would be nice to avoid accidental changes to characteristics of the nicely crafted structure.