use of com.qlangtech.tis.workflow.pojo.DatasourceTableCriteria in project tis by qlangtech.
the class TestCollectionAction method clearUpDB.
private void clearUpDB() {
IWorkflowDAOFacade wfDaoFacade = applicationContext.getBean("wfDaoFacade", IWorkflowDAOFacade.class);
DatasourceTableCriteria tabCriteria = new DatasourceTableCriteria();
tabCriteria.createCriteria().andNameEqualTo(TEST_TABLE_EMPLOYEES_NAME);
wfDaoFacade.getDatasourceTableDAO().deleteByExample(tabCriteria);
DatasourceDbCriteria dbCriteria = new DatasourceDbCriteria();
dbCriteria.createCriteria().andNameEqualTo(TEST_DS_NAME);
wfDaoFacade.getDatasourceDbDAO().deleteByExample(dbCriteria);
WorkFlowCriteria wfCriteria = new WorkFlowCriteria();
wfCriteria.createCriteria().andNameEqualTo(TEST_TABLE_EMPLOYEES_NAME);
wfDaoFacade.getWorkFlowDAO().deleteByExample(wfCriteria);
// daoContext" class="com.qlangtech.tis.manage.common.RunContextImpl
RunContext daoContext = applicationContext.getBean("daoContext", RunContext.class);
ApplicationCriteria appCriteria = new ApplicationCriteria();
appCriteria.createCriteria().andProjectNameEqualTo(TISCollectionUtils.NAME_PREFIX + TEST_TABLE_EMPLOYEES_NAME);
for (Application app : daoContext.getApplicationDAO().selectByExample(appCriteria)) {
ServerGroupCriteria sgCriteria = new ServerGroupCriteria();
sgCriteria.createCriteria().andAppIdEqualTo(app.getAppId());
daoContext.getServerGroupDAO().deleteByExample(sgCriteria);
}
daoContext.getApplicationDAO().deleteByExample(appCriteria);
for (Long gid : daoContext.getServerGroupDAO().getServergroupWithoutAppReference()) {
// assertNotNull(g.getGid());
daoContext.getServerGroupDAO().deleteByPrimaryKey(gid.intValue());
}
// select g.gid
// from server_group g left join application a on g.app_id = a.app_id
// where a.app_id is null
}
Aggregations