Refactored Operation DAO classes

revert-70aa11f8
Dileesha Rajapakse 9 years ago
parent cfb05db5fa
commit f3cfb79bac

@ -59,7 +59,7 @@ public class CommandOperationDAOImpl extends OperationDAOImpl {
try { try {
Connection connection = OperationManagementDAOFactory.getConnection(); Connection connection = OperationManagementDAOFactory.getConnection();
stmt = connection.prepareStatement( stmt = connection.prepareStatement(
"UPDATE DM_COMMAND_OPERATION O SET O.ENABLED = ? WHERE O.OPERATION_ID = ?"); "UPDATE DM_COMMAND_OPERATION SET ENABLED = ? WHERE OPERATION_ID = ?");
stmt.setBoolean(1, operation.isEnabled()); stmt.setBoolean(1, operation.isEnabled());
stmt.setInt(2, operation.getId()); stmt.setInt(2, operation.getId());
stmt.executeUpdate(); stmt.executeUpdate();

@ -82,8 +82,8 @@ public class ConfigOperationDAOImpl extends OperationDAOImpl {
try { try {
super.updateOperation(operation); super.updateOperation(operation);
Connection connection = OperationManagementDAOFactory.getConnection(); Connection connection = OperationManagementDAOFactory.getConnection();
stmt = connection.prepareStatement("UPDATE DM_CONFIG_OPERATION O SET O.OPERATION_CONFIG = ? " + stmt = connection.prepareStatement("UPDATE DM_CONFIG_OPERATION SET OPERATION_CONFIG = ? " +
"WHERE O.OPERATION_ID = ?"); "WHERE OPERATION_ID = ?");
bao = new ByteArrayOutputStream(); bao = new ByteArrayOutputStream();
oos = new ObjectOutputStream(bao); oos = new ObjectOutputStream(bao);
oos.writeObject(operation); oos.writeObject(operation);

@ -70,8 +70,8 @@ public class OperationDAOImpl implements OperationDAO {
PreparedStatement stmt = null; PreparedStatement stmt = null;
try { try {
Connection connection = OperationManagementDAOFactory.getConnection(); Connection connection = OperationManagementDAOFactory.getConnection();
stmt = connection.prepareStatement("UPDATE DM_OPERATION O SET O.RECEIVED_TIMESTAMP=? " + stmt = connection.prepareStatement("UPDATE DM_OPERATION SET RECEIVED_TIMESTAMP=? " +
"WHERE O.ID=?"); "WHERE ID=?");
stmt.setTimestamp(1, new Timestamp(new Date().getTime())); stmt.setTimestamp(1, new Timestamp(new Date().getTime()));
stmt.setInt(2, operation.getId()); stmt.setInt(2, operation.getId());
stmt.executeUpdate(); stmt.executeUpdate();

@ -90,8 +90,8 @@ public class PolicyOperationDAOImpl extends OperationDAOImpl {
try { try {
super.updateOperation(operation); super.updateOperation(operation);
Connection connection = OperationManagementDAOFactory.getConnection(); Connection connection = OperationManagementDAOFactory.getConnection();
stmt = connection.prepareStatement("UPDATE DM_POLICY_OPERATION O SET O.OPERATION_DETAILS=? " + stmt = connection.prepareStatement("UPDATE DM_POLICY_OPERATION SET OPERATION_DETAILS=? " +
"WHERE O.OPERATION_ID=?"); "WHERE OPERATION_ID=?");
bao = new ByteArrayOutputStream(); bao = new ByteArrayOutputStream();
oos = new ObjectOutputStream(bao); oos = new ObjectOutputStream(bao);
oos.writeObject(operation); oos.writeObject(operation);

@ -90,8 +90,8 @@ public class ProfileOperationDAOImpl extends OperationDAOImpl {
try { try {
super.updateOperation(operation); super.updateOperation(operation);
Connection connection = OperationManagementDAOFactory.getConnection(); Connection connection = OperationManagementDAOFactory.getConnection();
stmt = connection.prepareStatement("UPDATE DM_PROFILE_OPERATION O SET O.OPERATION_DETAILS=? " + stmt = connection.prepareStatement("UPDATE DM_PROFILE_OPERATION SET OPERATION_DETAILS=? " +
"WHERE O.OPERATION_ID=?"); "WHERE OPERATION_ID=?");
bao = new ByteArrayOutputStream(); bao = new ByteArrayOutputStream();
oos = new ObjectOutputStream(bao); oos = new ObjectOutputStream(bao);

Loading…
Cancel
Save