|
The problem of course is that when creating a proxy we do not have this information (or else we wouldn't be creating a proxy). And in order to get this information we'd have to hit the database to find out, which circumvents the benefit of using the proxy in the first place.
You do realize right that session.load(B.class, Id) creates a proxy typed as you expect right?
If you have a test showing a case where Hibernate has all the information it needs to choose the proper proxy (choose the proper concrete persister) given your scenario we will take a look.
|