mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge branch 'master' into 'master'
Remove duplicates in getApplications API Closes product-iots#342 See merge request entgra/carbon-device-mgt!467
This commit is contained in:
commit
d8d0530943
@ -277,9 +277,9 @@ public class ApplicationDAOImpl implements ApplicationDAO {
|
||||
throws DeviceManagementDAOException {
|
||||
List<Application> applications = new ArrayList<>();
|
||||
Application application;
|
||||
String sql = "Select " +
|
||||
"ID," +
|
||||
" NAME, " +
|
||||
String sql = "SELECT " +
|
||||
"ID, " +
|
||||
"NAME, " +
|
||||
"APP_IDENTIFIER, " +
|
||||
"PLATFORM, " +
|
||||
"CATEGORY, " +
|
||||
@ -291,8 +291,14 @@ public class ApplicationDAOImpl implements ApplicationDAO {
|
||||
"MEMORY_USAGE, " +
|
||||
"IS_ACTIVE, " +
|
||||
"TENANT_ID " +
|
||||
"From DM_APPLICATION " +
|
||||
"WHERE PLATFORM = ? " +
|
||||
"FROM DM_APPLICATION " +
|
||||
"WHERE NOT EXISTS " +
|
||||
"(SELECT " +
|
||||
"ID " +
|
||||
"FROM DM_APPLICATION A " +
|
||||
"WHERE A.NAME = DM_APPLICATION.NAME " +
|
||||
"AND A.ID < DM_APPLICATION.ID) " +
|
||||
"AND PLATFORM = ? " +
|
||||
"AND TENANT_ID = ? LIMIT ? OFFSET ?";
|
||||
try {
|
||||
Connection conn = this.getConnection();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user