mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Add fix for apps not loading
This commit is contained in:
parent
ababfc8100
commit
c4be66bc2e
@ -286,31 +286,36 @@ public class ApplicationDAOImpl implements ApplicationDAO {
|
||||
"IS_ACTIVE, " +
|
||||
"TENANT_ID " +
|
||||
"FROM DM_APPLICATION " +
|
||||
"WHERE NOT EXISTS " +
|
||||
"(SELECT " +
|
||||
"ID " +
|
||||
"WHERE PLATFORM = ? AND " +
|
||||
"TENANT_ID = ? AND " +
|
||||
"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 = ? ";
|
||||
"AND A.ID < DM_APPLICATION.ID AND " +
|
||||
"PLATFORM = ? AND TENANT_ID = ?) ";
|
||||
|
||||
try {
|
||||
String filter = request.getFilter();
|
||||
if (filter != null) {
|
||||
sql = sql + "AND NAME LIKE ? ";
|
||||
}
|
||||
if (request != null && request.getRowCount() != -1) {
|
||||
sql = sql + "LIMIT ? OFFSET ?";
|
||||
}
|
||||
Connection conn = this.getConnection();
|
||||
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
|
||||
int paramIdx = 1;
|
||||
stmt.setString(paramIdx++, request.getDeviceType());
|
||||
stmt.setInt(paramIdx++, tenantId);
|
||||
stmt.setString(paramIdx++, request.getDeviceType());
|
||||
stmt.setInt(paramIdx++, tenantId);
|
||||
if (filter != null){
|
||||
stmt.setString(paramIdx++, filter);
|
||||
}
|
||||
if (request != null && request.getRowCount() != -1) {
|
||||
stmt.setInt(paramIdx++, request.getRowCount());
|
||||
stmt.setInt(paramIdx, request.getStartIndex());
|
||||
|
||||
}
|
||||
try (ResultSet rs = stmt.executeQuery()) {
|
||||
while (rs.next()) {
|
||||
application = loadApplication(rs);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user