在one-to-many中,数据库里面有对应数据,为什么parent.getChilds() get不到值
[code]Parent.hbm.xml
<set name="chhilds" inverse="true" lazy="true" cascade="all">
<key column="chi_id"/>
<one-to-many class="Child"/>
</set>
Childs.hbm.xml
<many-to-one name="parent" column="par_id"
class="Parent" not-null="false" cascade="all">
</many-to-one>[/code]
是以前的一个SSH框架,采用openSessionInViewFillter,用的是hibernate2,spring的版本也相对较老.
请问为什么parent.getChilds() get不到值,是不是hibernate 和 spring 的版本原因,还是新的版本也会有这样的问题?
测试many-to-many没有问题
[code]Parent.hbm.xml
<set name="chhilds" inverse="true" lazy="true" cascade="all">
<key column="chi_id"/>
<one-to-many class="Child"/>
</set>
Childs.hbm.xml
<many-to-one name="parent" column="par_id"
class="Parent" not-null="false" cascade="all">
</many-to-one>[/code]
是以前的一个SSH框架,采用openSessionInViewFillter,用的是hibernate2,spring的版本也相对较老.
请问为什么parent.getChilds() get不到值,是不是hibernate 和 spring 的版本原因,还是新的版本也会有这样的问题?
测试many-to-many没有问题