mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
This commit is contained in:
parent
402b843e5d
commit
1fe9371558
@ -102,20 +102,17 @@ public class ApplicationMappingDAOImpl implements ApplicationMappingDAO {
|
|||||||
Connection conn;
|
Connection conn;
|
||||||
PreparedStatement stmt = null;
|
PreparedStatement stmt = null;
|
||||||
try {
|
try {
|
||||||
conn = this.getConnection();
|
|
||||||
String sql = "DELETE DM_DEVICE_APPLICATION_MAPPING WHERE DEVICE_ID = ? AND " +
|
String sql = "DELETE DM_DEVICE_APPLICATION_MAPPING WHERE DEVICE_ID = ? AND " +
|
||||||
"APPLICATION_ID = ? AND TENANT_ID = ?";
|
"APPLICATION_ID = ? AND TENANT_ID = ?";
|
||||||
|
|
||||||
conn.setAutoCommit(false);
|
conn = this.getConnection();
|
||||||
|
for (int appId : appIdList) {
|
||||||
stmt = conn.prepareStatement(sql);
|
stmt = conn.prepareStatement(sql);
|
||||||
|
|
||||||
for (Integer appId : appIdList) {
|
|
||||||
stmt.setInt(1, deviceId);
|
stmt.setInt(1, deviceId);
|
||||||
stmt.setInt(2, appId);
|
stmt.setInt(2, appId);
|
||||||
stmt.setInt(3, tenantId);
|
stmt.setInt(3, tenantId);
|
||||||
stmt.addBatch();
|
stmt.execute();
|
||||||
}
|
}
|
||||||
stmt.executeBatch();
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new DeviceManagementDAOException("Error occurred while adding device application mapping", e);
|
throw new DeviceManagementDAOException("Error occurred while adding device application mapping", e);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user