Fix only reading one result when multiple results are present

feature/appm-store/pbac
Yohan Avishke 5 years ago
parent 318d4e3f9c
commit 69aac07df5

@ -1837,7 +1837,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
List<Device> devices = new ArrayList<>(); List<Device> devices = new ArrayList<>();
DeviceInfo deviceInfo = new DeviceInfo(); DeviceInfo deviceInfo = new DeviceInfo();
if (rs.next()) { while (rs.next()) {
Device device = DeviceManagementDAOUtil.loadDevice(rs); Device device = DeviceManagementDAOUtil.loadDevice(rs);
deviceInfo.setOsVersion(rs.getString(Constants.OS_VERSION)); deviceInfo.setOsVersion(rs.getString(Constants.OS_VERSION));
deviceInfo.setOsBuildDate(rs.getString(Constants.OS_BUILD_DATE)); deviceInfo.setOsBuildDate(rs.getString(Constants.OS_BUILD_DATE));

@ -876,7 +876,7 @@ public class OracleDeviceDAOImpl extends AbstractDeviceDAOImpl {
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
List<Device> devices = new ArrayList<>(); List<Device> devices = new ArrayList<>();
DeviceInfo deviceInfo = new DeviceInfo(); DeviceInfo deviceInfo = new DeviceInfo();
if (rs.next()) { while (rs.next()) {
Device device = DeviceManagementDAOUtil.loadDevice(rs); Device device = DeviceManagementDAOUtil.loadDevice(rs);
deviceInfo.setOsVersion(rs.getString(Constants.OS_VERSION)); deviceInfo.setOsVersion(rs.getString(Constants.OS_VERSION));
deviceInfo.setOsBuildDate(rs.getString(Constants.OS_BUILD_DATE)); deviceInfo.setOsBuildDate(rs.getString(Constants.OS_BUILD_DATE));

Loading…
Cancel
Save