From 7eb53adca916d52dfeefcc6cf42ace19740a1c69 Mon Sep 17 00:00:00 2001 From: Sathira Perera Date: Mon, 2 Dec 2024 15:35:36 +0000 Subject: [PATCH] Enrolled devices should be shown with latest first (#544) Co-authored-by: sathira Reviewed-on: https://repository.entgra.net/community/device-mgt-core/pulls/544 Co-authored-by: Sathira Perera Co-committed-by: Sathira Perera --- .../device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java index 7159c3d33c..5cc02b7b4b 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java @@ -180,8 +180,7 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl { } else { sql += " GROUP BY e.ID "; } - sql += ") "; - sql += " LIMIT ? OFFSET ?"; + sql += ") ORDER BY d1.LAST_UPDATED_TIMESTAMP DESC LIMIT ? OFFSET ?"; try (PreparedStatement stmt = conn.prepareStatement(sql)) { int paramIdx = 1;