mirror of
https://gitee.com/freshday/radar.git
synced 2024-12-01 11:27:45 +08:00
delete the relation table when delete the model.
Signed-off-by: 烈日下的从容 <wfh45678@163.com>
This commit is contained in:
parent
7fc51bdc63
commit
38760c5dcd
@ -296,8 +296,33 @@ public class ModelDalImpl implements ModelDal {
|
|||||||
Example example = new Example(ModelPO.class);
|
Example example = new Example(ModelPO.class);
|
||||||
example.createCriteria().andIn("id", Arrays.asList(id));
|
example.createCriteria().andIn("id", Arrays.asList(id));
|
||||||
int count = modelMapper.deleteByExample(example);
|
int count = modelMapper.deleteByExample(example);
|
||||||
// TODO 删除关联子表
|
// 删除关联子表
|
||||||
return count;
|
example = new Example(FieldPO.class);
|
||||||
|
example.createCriteria().andIn("modelId", Arrays.asList(id));
|
||||||
|
fieldMapper.deleteByExample(example);
|
||||||
|
|
||||||
|
example = new Example(PreItemPO.class);
|
||||||
|
example.createCriteria().andIn("modelId", Arrays.asList(id));
|
||||||
|
preItemMapper.deleteByExample(example);
|
||||||
|
|
||||||
|
example = new Example(DataListsPO.class);
|
||||||
|
example.createCriteria().andIn("modelId", Arrays.asList(id));
|
||||||
|
dataListMapper.deleteByExample(example);
|
||||||
|
|
||||||
|
example = new Example(AbstractionPO.class);
|
||||||
|
example.createCriteria().andIn("modelId", Arrays.asList(id));
|
||||||
|
abstractionMapper.deleteByExample(example);
|
||||||
|
|
||||||
|
example = new Example(ActivationPO.class);
|
||||||
|
example.createCriteria().andIn("modelId", Arrays.asList(id));
|
||||||
|
activationMapper.deleteByExample(example);
|
||||||
|
|
||||||
|
example = new Example(RulePO.class);
|
||||||
|
example.createCriteria().andIn("modelId", Arrays.asList(id));
|
||||||
|
ruleMapper.deleteByExample(example);
|
||||||
|
|
||||||
|
|
||||||
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user