Refactored CommandOperation DAO class

revert-70aa11f8
Dileesha Rajapakse 9 years ago
parent a91e3056c7
commit 767ea70436

@ -134,7 +134,8 @@ public class CommandOperationDAOImpl extends OperationDAOImpl {
while (rs.next()) { while (rs.next()) {
commandOperation = new CommandOperation(); commandOperation = new CommandOperation();
commandOperation.setId(rs.getInt("ID")); commandOperation.setId(rs.getInt("ID"));
commandOperation.setEnabled(rs.getInt("ENABLED") != 0); //commandOperation.setEnabled(rs.getInt("ENABLED") != 0);
commandOperation.setEnabled(rs.getBoolean("ENABLED") != false);
commandOperation.setStatus(Operation.Status.valueOf(rs.getString("STATUS"))); commandOperation.setStatus(Operation.Status.valueOf(rs.getString("STATUS")));
commandOperation.setType(Operation.Type.valueOf(rs.getString("TYPE"))); commandOperation.setType(Operation.Type.valueOf(rs.getString("TYPE")));
commandOperation.setCreatedTimeStamp(rs.getString("CREATED_TIMESTAMP")); commandOperation.setCreatedTimeStamp(rs.getString("CREATED_TIMESTAMP"));

@ -316,6 +316,17 @@ CREATE TABLE IF NOT EXISTS DM_APPLICATION (
TENANT_ID INTEGER NOT NULL TENANT_ID INTEGER NOT NULL
); );
CREATE TABLE IF NOT EXISTS DM_DEVICE_APPLICATION_MAPPING (
ID BIGSERIAL NOT NULL PRIMARY KEY,
DEVICE_ID INTEGER NOT NULL,
APPLICATION_ID INTEGER NOT NULL,
TENANT_ID INTEGER NOT NULL,
CONSTRAINT fk_dm_device FOREIGN KEY (DEVICE_ID) REFERENCES
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT fk_dm_application FOREIGN KEY (APPLICATION_ID) REFERENCES
DM_APPLICATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
-- POLICY RELATED TABLES FINISHED -- -- POLICY RELATED TABLES FINISHED --
-- NOTIFICATION TABLE -- -- NOTIFICATION TABLE --

Loading…
Cancel
Save