Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update QueryMasterSpringDao.java #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public void renameQuery(String masterId, String queryNewName)
+ getDbSchemaName()
+ "qt_query_master set name = ? where query_master_id = ? and delete_flag = ?";
int updatedRow = jdbcTemplate.update(sql, new Object[] { queryNewName,
masterId, DELETE_NO_FLAG });
Integer.parseInt(masterId), DELETE_NO_FLAG });
if (updatedRow < 1) {
throw new I2B2DAOException("Query with master id " + masterId
+ " not found");
Expand Down Expand Up @@ -529,18 +529,18 @@ public void deleteQuery(String masterId) throws I2B2DAOException {
+ "qt_query_master set delete_flag =?,delete_date=? where query_master_id = ? and delete_flag = ?";
Date deleteDate = new Date(System.currentTimeMillis());
int queryMasterCount = jdbcTemplate.update(queryMasterSql,
new Object[] { DELETE_YES_FLAG, deleteDate, masterId,
new Object[] { DELETE_YES_FLAG, deleteDate, Integer.parseInt(masterId),
DELETE_NO_FLAG });
if (queryMasterCount < 1) {
throw new I2B2DAOException("Query not found with masterid =["
+ masterId + "]");
}

int queryInstanceCount = jdbcTemplate.update(queryInstanceSql,
new Object[] { DELETE_YES_FLAG, masterId, DELETE_NO_FLAG });
new Object[] { DELETE_YES_FLAG, Integer.parseInt(masterId), DELETE_NO_FLAG });
log.debug("Total no. of query instance deleted" + queryInstanceCount);
int queryResultInstanceCount = jdbcTemplate.update(resultInstanceSql,
new Object[] { DELETE_YES_FLAG, masterId });
new Object[] { DELETE_YES_FLAG, Integer.parseInt(masterId) });
log.debug("Total no. of query result deleted "
+ queryResultInstanceCount);
}
Expand Down