请问,我昨天做了个one to many 的例子,为什么一句执行了insert,而另外一句执行了update啊,我的目的是行都执行instert啊
u3.hbm.xml:
<hibernate-mapping>
<class name="onemany.u3" table="u3">
<id name="groupid" column="groupid" unsaved-value="0">
<generator class="assigned"/>
</id>
<property name="groupname" type="string" column="groupname"/>
<many-to-one name="u2" column="roleid"/>
</class>
</hibernate-mapping>
u2.hbm.xml:
<hibernate-mapping>
<class name="onemany.u2" table="u2">
<id name="roleid" type="int" column="roleid">
<generator class="assigned"/>
</id>
<property name="rolename" type="string" column="rolename"/>
<set name="accounts" lazy="false" inverse="true" cascade="all" sort="unsorted" >
<key column="roleid"/>
<one-to-many class="onemany/u3"/>
< t>