Gavin King (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-11936 (
https://hibernate.atlassian.net/browse/HHH-11936?atlOrigin=eyJpIjoiYmEzMj...
)
Re: Stabilize "empty composites" feature (
https://hibernate.atlassian.net/browse/HHH-11936?atlOrigin=eyJpIjoiYmEzMj...
)
Well maybe. Actually I would say it’s much more likely that it’s a class-level thing
because either an instance of the class X with all null properties makes sense or it
doesn't. I don't really see a usecase where in some contexts but not others you
can have a meaningful all-null X. Whether the fields of X can all be null is fundamentally
a characteristic of X itself and what it represents.
But of course I’m not against letting this stuff be set at the property level. That’s a
sort of flexibility we generally allow for embeddables, and there’s no specific reason to
not allow it here.
What it can’t possibly be is a global setting. A MonetaryAmount with all null fields is
never a meaningful monetary value no matter what “global” characteristics your program
has. And indeed it seems to me that the default behavior is always better and more correct
for at least the majority of embeddable classes in a program.
I mean, TBH, I really struggle to come up with even a single legit usecase for a class
with everything null, and nobody so far has ever been able to show me one. For every
concrete example I can think of, the default behavior is more correct. Perhaps you have a
convincing example that would help me understand the motivation for this? I admit that I
sometimes fall short on imagination. Even if you can think of an couple of great
motivating cases, I still insist that such cases will always be exceptional cases in every
program.
(
https://hibernate.atlassian.net/browse/HHH-11936#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-11936#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#100214- sha1:d3cc1a2 )