Re: [hibernate-dev] Null vs "empty" embeddable values

2017-07-26 Thread Steve Ebersole
It's absolutely enough. It's a best effort. I, for sure, do not want us checking this each and every time we need to check. That's excessively unwarranted. On Wed, Jul 26, 2017, 6:45 PM Gail Badner wrote: > IIUC, the fix for HHH-7610 was supposed to have Hibernate treat null and > empty compo

Re: [hibernate-dev] Null vs "empty" embeddable values

2017-07-26 Thread Gail Badner
IIUC, the fix for HHH-7610 was supposed to have Hibernate treat null and empty composite as equivalent, regardless of how hibernate.create_empty_composites.enabled is set. [1] The application could instantiate empty embeddables itself, and Hibernate should still treat those values as equivalent to

Re: [hibernate-dev] Null vs "empty" embeddable values

2017-07-26 Thread Steve Ebersole
No I mean checking on start up similar to what we do for composite id classes. So basically if this setting is enabled (treat all nulls == empty composite) make sure that the composite overrides equals/hashCode. On Wed, Jul 26, 2017 at 6:08 PM Gail Badner wrote: > Hi Steve, > > IIUC, you are

Re: [hibernate-dev] Null vs "empty" embeddable values

2017-07-26 Thread Gail Badner
Hi Steve, IIUC, you are suggesting: if ( !emptyValue.equals( null ) || emptyValue.hashCode() != 0 ) { LOG.warn( ... ); } I originally mentioned this issue with respect to Collection methods called on collections of embeddable values, but it could apply to empty/null embeddables in singular

Re: [hibernate-dev] Null vs "empty" embeddable values

2017-07-26 Thread Steve Ebersole
"Requirement" - no. I think a warning in this case is perfectly fine. As for JPA, it says nothing about embeddables and nulls. On Sun, Jul 23, 2017 at 6:49 PM Gail Badner wrote: > As of HHH-7610, Hibernate is supposed to treat null and empty embeddable > values as equivalent. > > Should we add

[hibernate-dev] Null vs "empty" embeddable values

2017-07-23 Thread Gail Badner
As of HHH-7610, Hibernate is supposed to treat null and empty embeddable values as equivalent. Should we add a requirement that an embeddable class #equals and #hashCode methods also treats null and "empty" values as equivalent? That would mean that #hashCode returned for all empty embeddables sh