To-many mapping in relation jeecg

1. First, a look at the front page:

There is a master table and three child tables, which show three sub code table as follows

<t:tabs id="tt" iframe="false" tabPosition="top" fit="false">

<t:tab
href="erpController.do?erpList&id=${erpPage.id}&tag=${tag}"
icon="icon-search" title="项目日志" id="xiangmu"></t:tab>
<t:tab
href="erpController.do?erpkpList&id=${erpPage.id}&tag=${tag}"
icon="icon-search" title="开票日志" id="Product"></t:tab>


<t:tab
href="erpController.do?erpskList&id=${erpPage.id}&tag=${tag}"
icon="icon-search" title="收款日志" id="shoukuan"></t:tab> 

</t:tabs>

Note that in the establishment of a database to build a main table and the corresponding three sub-tables

Meanwhile, when the sub-mapping table is not the same field of the main table

private ErpEntity erp;

private ErpEntity erpkp;

private ErpEntity erpsk;

First delete and then saved at the time of update

this.saveOrUpdate(erp);
for (ErpentryEntity s :erp.getErpentrylist()) {
this.delete(s);
}
for(ErpkpentryEntity erpkpentry: erp.getErpkpentrylist()){
this.delete(erpkpentry);
}

Guess you like

Origin www.cnblogs.com/Jeely/p/11310270.html
Recommended