Instansiate Policy DAO in operations dao factory

revert-70aa11f8
manoj 10 years ago
parent f8fbbdb467
commit 7fb3a594b8

@ -60,6 +60,7 @@ public class OperationManagerImpl implements OperationManager {
commandOperationDAO = OperationManagementDAOFactory.getCommandOperationDAO(); commandOperationDAO = OperationManagementDAOFactory.getCommandOperationDAO();
configOperationDAO = OperationManagementDAOFactory.getConfigOperationDAO(); configOperationDAO = OperationManagementDAOFactory.getConfigOperationDAO();
profileOperationDAO = OperationManagementDAOFactory.getProfileOperationDAO(); profileOperationDAO = OperationManagementDAOFactory.getProfileOperationDAO();
policyOperationDAO = OperationManagementDAOFactory.getPolicyOperationDAO();
operationMappingDAO = OperationManagementDAOFactory.getOperationMappingDAO(); operationMappingDAO = OperationManagementDAOFactory.getOperationMappingDAO();
operationDAO = OperationManagementDAOFactory.getOperationDAO(); operationDAO = OperationManagementDAOFactory.getOperationDAO();
deviceManagementService = new DeviceManagementServiceImpl(); deviceManagementService = new DeviceManagementServiceImpl();

@ -49,6 +49,10 @@ public class OperationManagementDAOFactory {
return new ProfileOperationDAOImpl(); return new ProfileOperationDAOImpl();
} }
public static OperationDAO getPolicyOperationDAO() {
return new PolicyOperationDAOImpl();
}
public static OperationMappingDAO getOperationMappingDAO() { public static OperationMappingDAO getOperationMappingDAO() {
return new OperationMappingDAOImpl(); return new OperationMappingDAOImpl();
} }

@ -182,7 +182,7 @@ public class ConfigOperationDAOImpl extends OperationDAOImpl {
try { try {
Connection conn = OperationManagementDAOFactory.getConnection(); Connection conn = OperationManagementDAOFactory.getConnection();
String sql = "Select co.OPERATION_ID, ENABLED, OPERATION_DETAILS from DM_CONFIG_OPERATION co " + String sql = "Select co.OPERATION_ID, co.OPERATION_CONFIG from DM_CONFIG_OPERATION co " +
"INNER JOIN " + "INNER JOIN " +
"(Select * From DM_DEVICE_OPERATION_MAPPING WHERE DEVICE_ID=? " + "(Select * From DM_DEVICE_OPERATION_MAPPING WHERE DEVICE_ID=? " +
"AND STATUS=?) dm ON dm.OPERATION_ID = co.OPERATION_ID"; "AND STATUS=?) dm ON dm.OPERATION_ID = co.OPERATION_ID";
@ -194,7 +194,7 @@ public class ConfigOperationDAOImpl extends OperationDAOImpl {
rs = stmt.executeQuery(); rs = stmt.executeQuery();
while (rs.next()) { while (rs.next()) {
byte[] operationDetails = rs.getBytes("OPERATION_DETAILS"); byte[] operationDetails = rs.getBytes("OPERATION_CONFIG");
bais = new ByteArrayInputStream(operationDetails); bais = new ByteArrayInputStream(operationDetails);
ois = new ObjectInputStream(bais); ois = new ObjectInputStream(bais);
configOperation = (ConfigOperation) ois.readObject(); configOperation = (ConfigOperation) ois.readObject();

Loading…
Cancel
Save