You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That would be good. Until then I think a compile-time-warning for fields named target or even a compile-time-error would be necessary. And this behaviour documented.
The text was updated successfully, but these errors were encountered:
We have a problem that appears if we use
compile ":hibernate:3.6.10.18"
but is ok with
compile ":hibernate:3.6.10.17"
It seems to be because of this commit
0a24b76#diff-b9a5a8c718a76728eab6fcf82cf4212b
If we have a field named 'target' that is lazy-loaded, we get a ClassCastException because the object itself is returned instead of the field.
Probably because this code is called earlier now (see github-link)
It's very easy to reproduce. This snippet will not work.
But this will.
If accessing the field and not knowing how it was loaded it's a confusing error.
When it's not lazy-loaded it doesn't happen, so it can be hard to find.
So I think all projects that use a field named target that sometimes loads lazy will break.
Lari suggests target is renamed proxyTarget in EntityProxy some day.
( https://groups.google.com/forum/#!topic/grails-dev-discuss/Vq-c1oTyKjo )
That would be good. Until then I think a compile-time-warning for fields named target or even a compile-time-error would be necessary. And this behaviour documented.
The text was updated successfully, but these errors were encountered: