项目里的一个表级联突然就不生效了,注意 是 突然
实体类如下:省略掉了该省略的..
public class ApplyForm {
private Map<String, String> extValue;
}
下面是映射文件:
<class name="ApplyForm" table="sv_apply_form"> <map name="extValue" table="sv_apply_form_ext_value" cascade="all-delete-orphan"> <key column="apply_form_id" not-null="true"/> <map-key column="field_uuid" type="string" length="64"/> <element column="field_value" type="text"/> </map> </class>
怎么看都没问题,而且之前用的好好的,于是就看数据库外键,发现问题
将更新和删除属性设置为"cascade",OK问题解决!
记录防忘!