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