Fix issue in duplicate mapping

merge-requests/7/head
charitha 8 years ago
parent 94a50584f4
commit 664b3d4d43

@ -616,7 +616,9 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
if (device == null) { if (device == null) {
throw new DeviceNotFoundException("Device not found for id '" + deviceIdentifier.getId() + "'"); throw new DeviceNotFoundException("Device not found for id '" + deviceIdentifier.getId() + "'");
} }
this.groupDAO.addDevice(groupId, device.getId(), tenantId); if (!this.groupDAO.isDeviceMappedToGroup(groupId, device.getId(), tenantId)){
this.groupDAO.addDevice(groupId, device.getId(), tenantId);
}
} }
GroupManagementDAOFactory.commitTransaction(); GroupManagementDAOFactory.commitTransaction();
} catch (DeviceManagementException e) { } catch (DeviceManagementException e) {

Loading…
Cancel
Save