Hibernnate的one-to-mang
[code=Java][/code]
<hibernate-mapping>
<class name="qh.merchinfo.Merchinfo" table="MERCHINFO" lazy="false">
<id name="merchId" type="java.lang.String">
<column name="MERCH_ID" length="20" />
<generator class="assigned"></generator>
</id>
<property name="merchname" type="java.lang.String">
<column name="MERCHNAME" length="50" not-null="true" />
</property>
<property name="merchprice" type="double">
<column name="MERCHPRICE" precision="6" />
</property>
<property name="importprice" type="double">
<column name="IMPORTPRICE" precision="6" />
</property>
<property name="provideId" type="java.lang.String">
<column name="PROVIDE_ID" length="20" not-null="true" />
</property>
<property name="colorclass" type="java.lang.String">
<column name="COLORCLASS" length="20" />
</property>
<property name="styleclass" type="java.lang.String">
<column name="STYLECLASS" length="20" />
</property>
<property name="clothessize" type="java.lang.String">
<column name="CLOTHESSIZE" length="20" />
</property>
<property name="barcode" type="java.lang.String">
<column name="BARCODE" length="50" />
</property>
<property name="salesstart" type="date">
<column name="SALESSTART" length="23" />
</property>
<property name="salesend" type="date">
<column name="SALESEND" length="23" />
</property>
</class>
</hibernate-mapping>
在反向工程的时候,如果选上多对一后面就会报错。现在我在做B/S程序是,不能删除被引用的主表信息,不知道怎么样配置<set> </set>
------解决方案--------------------
举个例子: <!-- column 外键
inverse 放弃控制权(不去维护关系 )
-->
<set name="jds" inverse="true" cascade="all">
<key column="qxid"></key>
<one-to-many class="pojo.TblJd"/>
</set>