Fix operations sql changing column names operation details

revert-70aa11f8
manoj 10 years ago
parent 79444e951a
commit bc10bf9257

@ -256,10 +256,10 @@ public class OperationDAOImpl implements OperationDAO {
try { try {
Connection conn = OperationManagementDAOFactory.getConnection(); Connection conn = OperationManagementDAOFactory.getConnection();
String sql = "SELECT o.ID, o.TYPE, o.CREATED_TIMESTAMP, o.RECEIVED_TIMESTAMP, o.STATUS, o.OPERATIONCODE, " + String sql = "SELECT o.ID, o.TYPE, o.CREATED_TIMESTAMP, o.RECEIVED_TIMESTAMP, o.STATUS, o.OPERATION_CODE, " +
"po.OPERATIONDETAILS,co.ENABLED from " + "po.OPERATION_DETAILS,co.ENABLED from " +
"(SELECT ID, TYPE, CREATED_TIMESTAMP, RECEIVED_TIMESTAMP, STATUS, " + "(SELECT ID, TYPE, CREATED_TIMESTAMP, RECEIVED_TIMESTAMP, STATUS, " +
"OPERATIONCODE FROM DM_OPERATION WHERE STATUS=?) o " + "OPERATION_CODE FROM DM_OPERATION WHERE STATUS=?) o " +
"INNER JOIN (Select * from DM_DEVICE_OPERATION_MAPPING dm " + "INNER JOIN (Select * from DM_DEVICE_OPERATION_MAPPING dm " +
"where dm.DEVICE_ID=?) om ON o.ID = om.OPERATION_ID LEFT OUTER JOIN DM_PROFILE_OPERATION po ON " + "where dm.DEVICE_ID=?) om ON o.ID = om.OPERATION_ID LEFT OUTER JOIN DM_PROFILE_OPERATION po ON " +
"o.ID =po.OPERATION_ID LEFT OUTER JOIN DM_COMMAND_OPERATION co ON co.OPERATION_ID=o.ID"; "o.ID =po.OPERATION_ID LEFT OUTER JOIN DM_COMMAND_OPERATION co ON co.OPERATION_ID=o.ID";
@ -329,10 +329,10 @@ public class OperationDAOImpl implements OperationDAO {
try { try {
Connection conn = OperationManagementDAOFactory.getConnection(); Connection conn = OperationManagementDAOFactory.getConnection();
String sql = "SELECT o.ID, o.TYPE, o.CREATED_TIMESTAMP, o.RECEIVED_TIMESTAMP, o.STATUS, o.OPERATIONCODE, " + String sql = "SELECT o.ID, o.TYPE, o.CREATED_TIMESTAMP, o.RECEIVED_TIMESTAMP, o.STATUS, o.OPERATION_CODE, " +
"po.OPERATIONDETAILS,co.ENABLED from " + "po.OPERATION_DETAILS,co.ENABLED from " +
"(SELECT ID, TYPE, CREATED_TIMESTAMP, RECEIVED_TIMESTAMP, STATUS, " + "(SELECT ID, TYPE, CREATED_TIMESTAMP, RECEIVED_TIMESTAMP, STATUS, " +
"OPERATIONCODE FROM DM_OPERATION) o " + "OPERATION_CODE FROM DM_OPERATION) o " +
"INNER JOIN (Select * from DM_DEVICE_OPERATION_MAPPING dm " + "INNER JOIN (Select * from DM_DEVICE_OPERATION_MAPPING dm " +
"where dm.DEVICE_ID=?) om ON o.ID = om.OPERATION_ID LEFT OUTER JOIN DM_PROFILE_OPERATION po ON " + "where dm.DEVICE_ID=?) om ON o.ID = om.OPERATION_ID LEFT OUTER JOIN DM_PROFILE_OPERATION po ON " +
"o.ID =po.OPERATION_ID LEFT OUTER JOIN DM_COMMAND_OPERATION co ON co.OPERATION_ID=o.ID"; "o.ID =po.OPERATION_ID LEFT OUTER JOIN DM_COMMAND_OPERATION co ON co.OPERATION_ID=o.ID";
@ -404,7 +404,7 @@ public class OperationDAOImpl implements OperationDAO {
String sql = "SELECT o.ID, o.TYPE, o.CREATED_TIMESTAMP, o.RECEIVED_TIMESTAMP, o.STATUS, o.OPERATION_CODE,"+ String sql = "SELECT o.ID, o.TYPE, o.CREATED_TIMESTAMP, o.RECEIVED_TIMESTAMP, o.STATUS, o.OPERATION_CODE,"+
"po.OPERATION_DETAILS,co.ENABLED from "+ "po.OPERATION_DETAILS,co.ENABLED from "+
"(SELECT ID, TYPE, CREATED_TIMESTAMP, RECEIVED_TIMESTAMP, STATUS,"+ "(SELECT ID, TYPE, CREATED_TIMESTAMP, RECEIVED_TIMESTAMP, STATUS,"+
"OPERATIONCODE FROM DM_OPERATION WHERE STATUS=?) o "+ "OPERATION_CODE FROM DM_OPERATION WHERE STATUS=?) o "+
"LEFT OUTER JOIN DM_PROFILE_OPERATION po ON "+ "LEFT OUTER JOIN DM_PROFILE_OPERATION po ON "+
"o.ID =po.OPERATION_ID LEFT OUTER JOIN DM_COMMAND_OPERATION co ON co.OPERATION_ID=o.ID"; "o.ID =po.OPERATION_ID LEFT OUTER JOIN DM_COMMAND_OPERATION co ON co.OPERATION_ID=o.ID";

@ -70,7 +70,7 @@ public class ProfileOperationDAOImpl extends OperationDAOImpl {
try { try {
Connection connection = OperationManagementDAOFactory.getConnection(); Connection connection = OperationManagementDAOFactory.getConnection();
stmt = connection.prepareStatement( stmt = connection.prepareStatement(
"SELECT po.OPERATION_DETAILS AS OPERATIONDETAILS " + "SELECT po.OPERATION_DETAILS AS OPERATION_DETAILS " +
"FROM DM_OPERATION o " + "FROM DM_OPERATION o " +
"INNER JOIN DM_PROFILE_OPERATION po ON o.ID = po.OPERATION_ID AND o.STATUS =? AND o.ID IN (" "INNER JOIN DM_PROFILE_OPERATION po ON o.ID = po.OPERATION_ID AND o.STATUS =? AND o.ID IN ("
+ +
@ -86,7 +86,7 @@ public class ProfileOperationDAOImpl extends OperationDAOImpl {
byte[] operationDetails = new byte[0]; byte[] operationDetails = new byte[0];
if (rs.next()) { if (rs.next()) {
operationDetails = rs.getBytes("OPERATIONDETAILS"); operationDetails = rs.getBytes("OPERATION_DETAILS");
} }
bais = new ByteArrayInputStream(operationDetails); bais = new ByteArrayInputStream(operationDetails);
ois = new ObjectInputStream(bais); ois = new ObjectInputStream(bais);

Loading…
Cancel
Save