ltcmelo wrote:
You're right! There're two declarations!
I fixed that. However, I tried with both outer-join=false and outer-join=true and still got the same error. Only with lazy instantiation set to false, it works.
Thanks.
I've just looked at how I've done many-to-many mappings in the past, and I use the following declaration (again xdoclet):
Code:
/**
* @hibernate.set table="EMPLOYEE_RATIONALES" cascade="all" lazy="true" outer-join="false"
* @hibernate.collection-key column="EMPLID"
* @hibernate.collection-many-to-many class="com.spl.comptool.hibernate.v2.Rationale" column="RATIONALE_ID"
*/
public java.util.Set getRationaleSet() {
...
}
The only difference I can see is that the method is declared as returning a Set, not a Collection, and that I don't specify foreign keys (which should be irrelevent).
I do not however, check for null sets in this method, instead I do it as an additional method in the class (for example, getRationaleSetComplete()) - It's possible that the proxying happens _after_ the running of your getter, and so the value gets reset to null.
I don't know enough about proxying, but I do know I've had issues setting values in hibernate-proxied methods before,
If this doesn't work, can you for completeness please send the relevent portion of the xdoclet-generated mapping file for this class?