Hibernate version: Hibernate 3.1.2
I have a one-to-many relationship to a set of objects that may or may not be there. In hibernate2 we would always get an empty set returned. In hibernate3 I we sometimes get an empty set and sometimes a null.
I am currently trying to figure out why the change (lazy set to true false, inverse settings, etc). I am trying to determine if there is a bug in our mapping file, generated class, or if there is a bug in hibernate 3 or if this is designed? If it is "as designed" I at least know not to keep trying to "fix" it.
If this is "as designed" any additional information to when it is null vs. when it is an empty set would be appriciated.
Code:
<set name="somethingSets" lazy="true" cascade="none" inverse="true">
<meta attribute="scope-set">private</meta>
<meta attribute="scope-get">public</meta>
<key column="KEY_ID"/>
<one-to-many class="SomethingImpl"/>
</set>
I have tried changing the lazy, inverse, and cascade attributes w/out any success.
I have also tried to initialize the set to an empty hashSet in the generated class, but no luck either
Code:
private Set somethingSets = new HashSet();
Thanks.
-Neil