Hello friends,
I am stuck with this issue. The problem is when an empty collection is returned by hibernate and I try to add a new element to it, hibernate raises the error "collection is not associated with any session". But when this collection has one or more elements then hibernate allows me to add new element.
<class name = "Organisation" schema="dbo" table="ORGANISATION_ELEMENT">
<set inverse="true" name="children" cascade="all" lazy="extra" order-by="NAME asc"> <key column="P_SERIAL" update="true"/> <one-to-many class="Organisation" /> </set>
</class>
Also can anyone tell me that whether hibernate maintain reference to the object of empty list in session.
Looking forward for your replies.
Regards Mansoor
|