清除JBPM数据的SQL
来源:互联网 发布:linux命令文件大小变化 编辑:程序博客网 时间:2024/06/05 06:07
JBPM的表使用了非常多的外键,通过外键实现数据的完整性约束。
当我们希望手工清除JBPM的数据时,这些外键就给我们带来了较大的困扰。
以下是根据经验整理出来的SQL,以备查(JBPM3.1.1版本):
- delete
- from jbpm_log
- where token_ in(
- select id_
- from jbpm_token
- where processinstance_ in(
- select id_
- from Jbpm_Processinstance
- where id_ in(select processid from biz_table where title like 'condition %')
- )
- );
- delete
- from jbpm_taskactorpool
- where taskinstance_ in(
- select id_
- from jbpm_taskinstance
- where token_ in(
- select id_
- from jbpm_token
- where processinstance_ in(
- select id_
- from Jbpm_Processinstance
- where id_ in(select processid from biz_table where title like 'condition %')
- )
- )
- );
- delete
- from jbpm_variableinstance
- where processinstance_ in(
- select id_
- from Jbpm_Processinstance
- where id_ in(select processid from biz_table where title like 'condition %')
- );
- delete
- from jbpm_timer
- where processinstance_ in(
- select id_
- from Jbpm_Processinstance
- where id_ in(select processid from biz_table where title like 'condition %')
- );
- delete
- from jbpm_taskinstance
- where token_ in(
- select id_
- from jbpm_token
- where processinstance_ in(
- select id_
- from Jbpm_Processinstance
- where id_ in(select processid from biz_table where title like 'condition %')
- )
- );
- delete
- from jbpm_tokenvariablemap
- where token_ in(
- select id_
- from jbpm_token
- where processinstance_ in(
- select id_
- from Jbpm_Processinstance
- where id_ in(select processid from biz_table where title like 'condition %')
- )
- );
- alter table JBPM_PROCESSINSTANCE disable constraint FK_PROCIN_ROOTTKN;
- delete
- from jbpm_token
- where processinstance_ in(
- select id_
- from Jbpm_Processinstance
- where id_ in(select processid from biz_table where title like 'condition %')
- );
- delete
- from jbpm_moduleinstance
- where processinstance_ in(
- select id_
- from Jbpm_Processinstance
- where id_ in(select processid from biz_table where title like 'condition %')
- );
- delete
- from Jbpm_Processinstance
- where id_ in(select processid from biz_table where title like 'condition %');
- alter table JBPM_PROCESSINSTANCE enable constraint FK_PROCIN_ROOTTKN;
- delete from biz_table where title like 'condition %';
- commit;
根据实际情况将条件部分的SQL替换掉。这些SQL会彻底清除JBPM中的数据。
- 清除JBPM数据的SQL
- SQL循环清除表数据
- mysql 快速清除指定表中数据的sql语句
- 清除数据的
- 经常面试到的SQL题(查询重复数据和清除重复数据)
- 清除 SQL Server 2005 数据日志
- 清除sql表中所有数据
- sql server 清除某个数据库所有数据
- mysql:sql truncate (清除表数据)
- 清除mysql表的数据
- 清除数据的所有内容
- 清除缓存数据的方法
- android 中清除应用的数据会清除哪些数据
- android 中清除应用的数据会清除哪些数据
- 清除SQL Server数据缓存和执行计划缓存,查看执行计划的各种方式对比
- MSSQL中如何用SQL清除所有表的数据(downmoon)?
- MSSQL中如何用SQL清除所有表的数据(downmoon)
- Oracle中关于清除数据释放表空间等方面的sql
- Python的爬虫程序
- 教你做课程设计!
- VSS配置
- 第三篇:dom4j解析XML的基本用法
- 国内外开源间反差巨大2009中国回到原点
- 清除JBPM数据的SQL
- 键盘"全局钩子"的使用 ..
- Adding assembly to GAC
- UML之 用例图
- sql 2005事务
- 站在上帝的高度看80后程序员未来
- 第四篇:glassfish的简单安装配置(windows)
- sql批量增加和修改语句
- LNK2019 ImagingFactory 错误