Gavin King (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-15737 (
https://hibernate.atlassian.net/browse/HHH-15737?atlOrigin=eyJpIjoiZDVhZW...
)
Re: Support for Inheritance and Bytecode Enchanced Lazy Loading (
https://hibernate.atlassian.net/browse/HHH-15737?atlOrigin=eyJpIjoiZDVhZW...
)
I investigated this at length last week, and, after several false starts and backtracks,
concluded that the right action to take here is was simply to deprecate @LazyToOne , since
it seems to have no useful effect, at least not in H6.
Frankly, the whole deal with @LazyToOne is so confusing that I’m still not sure I
understand what it was ever meant to do, nor when it stopped doing what it was originally
meant to do, nor whether it was ever a nice thing to have. And the tests for this feature
are a total mess, which implies that other team members are equally confused about it. So
I’m pretty certain that no regular user can possibly understand it.
In particular, if I simply disable the effect of NO_PROXY in either the H6.2 or H5.6 test
suite, all the tests still pass. So whatever effect it originally had, if any, was
untested.
On the other hand, I argue that there’s nothing to “fix” here. Being able to get the id of
an associated entity without loading it is way better than being able to hit it with the
instanceof operator. It lets you do cool stuff like set up references to the unloaded
object, use the id as a query parameter, pass the id to the UI, etc. And the current
implementation lets you do that, whether or not bytecode enhancement is enabled. Which is
good and consistent.
We have no good objective reason to make that configurable, even for users who might find
it aesthetically objectionable. We have always had Hibernate.getClass() , and now we also
have the new shortcut
https://hibernate.atlassian.net/browse/HHH-15740 (
https://hibernate.atlassian.net/browse/HHH-15740 ) for dealing with proxies.
So, that’s a long way of saying I believe this issue can be closed. I was unable to
reproduce the behavior described in H5, and I don’t want anyone else to waste their time
diving down this rabbit hole.
(
https://hibernate.atlassian.net/browse/HHH-15737#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15737#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100210- sha1:eab5823 )