hibernate all-delete-orphan
(1)
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.gdcn.gpms.pms.GDTEC.scgl.model.ForeignAccountsApprove" table="gdtec_foreignAccountsApprove">
<id name="resourceid" type="java.lang.String">
<column name="resourceid" length="32" />
<generator class="uuid.hex" />
</id>
<set name="foreignAccountsApproveChildSet" lazy="true" inverse="true" cascade="all-delete-orphan" order-by="serialNumber">
<key>
<column name="relationId"></column>
</key>
<one-to-many class="com.gdcn.gpms.pms.GDTEC.scgl.model.ForeignAccountsApproveChild"/>
</set>
</class>
</hibernate-mapping>
(N)
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
<class name="com.gdcn.gpms.pms.GDTEC.scgl.model.ForeignAccountsApproveChild" table="gdtec_foreignAccountsApproveChild">
<id name="resourceid" type="java.lang.String">
<column name="resourceid" length="32" />
<generator class="uuid.hex" />
</id>
<property name="subjectRemark" />
<many-to-one name="foreignAccountsApprove" class="com.gdcn.gpms.pms.GDTEC.scgl.model.ForeignAccountsApprove" cascade="save-update" insert="false" update="false">
<column name="relationId"></column>
</many-to-one>
</class>
</hibernate-mapping>
:
service_ForeignAccountsApprove.saveEntity(foreignAccountsApprove);
this.dd( foreignAccountsApprove, request) ;
service_ForeignAccountsApprove.updateEntity(foreignAccountsApprove);
:
service_ForeignAccountsApproveChild.removeForeignAccountsApproveChildByParentId(foreignAccountsApprove.getResourceid());
service_ForeignAccountsApprove.updateEntity(foreignAccountsApprove);
this.dd( foreignAccountsApprove, request) ;
service_ForeignAccountsApprove.updateEntity(foreignAccountsApprove);
:
private void dd(ForeignAccountsApprove fg, HttpServletRequest request) {
Set<ForeignAccountsApproveChild> childForegin = fg.getForeignAccountsApproveChildSet();
childForegin.clear();
String[] subjectRemark = request.getParameterValues("subjectRemark"); //
for (int x = 0; x < subjectRemark .length; x++) {
ForeignAccountsApproveChild foreignAccountsApproveChild
= new ForeignAccountsApproveChild();
foreignAccountsApproveChild.setSubjectRemark(StringHelper.doWithNull(subjectRemark[x]));
foreignAccountsApproveChild.setForeignAccountsApprove(fg);
childForegin.add(foreignAccountsApproveChild);
}
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
XML이란 무엇입니까?이것은 저장, 검색 및 공유할 수 있는 형식으로 데이터를 저장하는 강력한 방법입니다. 가장 중요한 것은 XML의 기본 형식이 표준화되어 있기 때문에 시스템이나 플랫폼 간에 로컬 또는 인터넷을 통해 XML을 공유하거나...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.