hibernate one-to-one不能级联删除能级联删除 10
<!DOCTYPEhibernate-mappingPUBLIC"-//Hibernate/HibernateMappingDTD3.0//EN""http://hibe...
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.yiqi.po">
<class name="Man" table="MAN">
<id name="peoId" column="PEOID" type="int">
<generator class="assigned"></generator>
</id>
<property name="manName" column="MANNAME" type="java.lang.String"></property>
<one-to-one name="women" class="Women" outer-join="true" cascade="all">
</one-to-one>
</class>
<class name="Women" table="WOMEN">
<id name="peoId" column="PEOID" type="int">
<generator class="foreign">
<param name="property">man</param>
</generator>
</id>
<property name="WomenName" column="WOMENNAME" type="java.lang.String"></property>
<one-to-one name="man" class="Man" outer-join="true" cascade="all"></one-to-one>
</class>
</hibernate-mapping>
满意追分。 展开
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.yiqi.po">
<class name="Man" table="MAN">
<id name="peoId" column="PEOID" type="int">
<generator class="assigned"></generator>
</id>
<property name="manName" column="MANNAME" type="java.lang.String"></property>
<one-to-one name="women" class="Women" outer-join="true" cascade="all">
</one-to-one>
</class>
<class name="Women" table="WOMEN">
<id name="peoId" column="PEOID" type="int">
<generator class="foreign">
<param name="property">man</param>
</generator>
</id>
<property name="WomenName" column="WOMENNAME" type="java.lang.String"></property>
<one-to-one name="man" class="Man" outer-join="true" cascade="all"></one-to-one>
</class>
</hibernate-mapping>
满意追分。 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询