|
|
@ -88,7 +88,7 @@ public class ApplicationDAOImpl implements ApplicationDAO {
|
|
|
|
conn = this.getConnection();
|
|
|
|
conn = this.getConnection();
|
|
|
|
stmt = conn.prepareStatement("UPDATE DM_APPLICATION SET NAME = ?, PLATFORM = ?, CATEGORY = ?, " +
|
|
|
|
stmt = conn.prepareStatement("UPDATE DM_APPLICATION SET NAME = ?, PLATFORM = ?, CATEGORY = ?, " +
|
|
|
|
"VERSION = ?, TYPE = ?, LOCATION_URL = ?, IMAGE_URL = ?, MEMORY_USAGE = ?, IS_ACTIVE = ? " +
|
|
|
|
"VERSION = ?, TYPE = ?, LOCATION_URL = ?, IMAGE_URL = ?, MEMORY_USAGE = ?, IS_ACTIVE = ? " +
|
|
|
|
"WHERE APP_IDENTIFIER = ? AND DEVICE_ID = ? AND ENROLMENT_ID = ? AND TENANT_ID = ?");
|
|
|
|
"WHERE ID = ?");
|
|
|
|
|
|
|
|
|
|
|
|
for (Application application : applications) {
|
|
|
|
for (Application application : applications) {
|
|
|
|
stmt.setString(1, application.getName());
|
|
|
|
stmt.setString(1, application.getName());
|
|
|
@ -100,10 +100,7 @@ public class ApplicationDAOImpl implements ApplicationDAO {
|
|
|
|
stmt.setString(7, application.getImageUrl());
|
|
|
|
stmt.setString(7, application.getImageUrl());
|
|
|
|
stmt.setInt(8, application.getMemoryUsage());
|
|
|
|
stmt.setInt(8, application.getMemoryUsage());
|
|
|
|
stmt.setBoolean(9, application.isActive());
|
|
|
|
stmt.setBoolean(9, application.isActive());
|
|
|
|
stmt.setString(10, application.getApplicationIdentifier());
|
|
|
|
stmt.setInt(10, application.getId());
|
|
|
|
stmt.setInt(11, deviceId);
|
|
|
|
|
|
|
|
stmt.setInt(12, enrolmentId);
|
|
|
|
|
|
|
|
stmt.setInt(13, tenantId);
|
|
|
|
|
|
|
|
stmt.addBatch();
|
|
|
|
stmt.addBatch();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stmt.executeBatch();
|
|
|
|
stmt.executeBatch();
|
|
|
@ -123,14 +120,10 @@ public class ApplicationDAOImpl implements ApplicationDAO {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
conn = this.getConnection();
|
|
|
|
conn = this.getConnection();
|
|
|
|
conn.setAutoCommit(false);
|
|
|
|
conn.setAutoCommit(false);
|
|
|
|
stmt = conn.prepareStatement("DELETE FROM DM_APPLICATION WHERE APP_IDENTIFIER = ? AND DEVICE_ID = ? " +
|
|
|
|
stmt = conn.prepareStatement("DELETE FROM DM_APPLICATION WHERE ID = ?");
|
|
|
|
"AND ENROLMENT_ID = ? AND TENANT_ID = ?");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Application app : apps) {
|
|
|
|
for (Application app : apps) {
|
|
|
|
stmt.setString(1, app.getApplicationIdentifier());
|
|
|
|
stmt.setInt(1, app.getId());
|
|
|
|
stmt.setInt(2, deviceId);
|
|
|
|
|
|
|
|
stmt.setInt(3, enrolmentId);
|
|
|
|
|
|
|
|
stmt.setInt(4, tenantId);
|
|
|
|
|
|
|
|
stmt.addBatch();
|
|
|
|
stmt.addBatch();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stmt.executeBatch();
|
|
|
|
stmt.executeBatch();
|
|
|
|