mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge pull request 'Add fix to load apps and create app' (#68) from prathabanKavin/device-mgt-core:mssqlcreateappfix into master
Reviewed-on: https://repository.entgra.net/community/device-mgt-core/pulls/68
This commit is contained in:
commit
b51a608a41
@ -94,6 +94,7 @@ public class SQLServerApplicationDAOImpl extends GenericApplicationDAOImpl {
|
|||||||
|| StringUtils.isNotEmpty(filter.getAppReleaseType())) {
|
|| StringUtils.isNotEmpty(filter.getAppReleaseType())) {
|
||||||
sql += "LEFT JOIN AP_APP_RELEASE ON AP_APP.ID = AP_APP_RELEASE.AP_APP_ID ";
|
sql += "LEFT JOIN AP_APP_RELEASE ON AP_APP.ID = AP_APP_RELEASE.AP_APP_ID ";
|
||||||
}
|
}
|
||||||
|
sql += "WHERE AP_APP.TENANT_ID = ? ";
|
||||||
if (StringUtils.isNotEmpty(filter.getAppType()) && !Constants.ALL.equalsIgnoreCase(filter.getAppType())) {
|
if (StringUtils.isNotEmpty(filter.getAppType()) && !Constants.ALL.equalsIgnoreCase(filter.getAppType())) {
|
||||||
sql += "AND AP_APP.TYPE = ? ";
|
sql += "AND AP_APP.TYPE = ? ";
|
||||||
}
|
}
|
||||||
@ -128,7 +129,7 @@ public class SQLServerApplicationDAOImpl extends GenericApplicationDAOImpl {
|
|||||||
sql += filter.getSortBy() +" ";
|
sql += filter.getSortBy() +" ";
|
||||||
}
|
}
|
||||||
if (filter.getLimit() != -1) {
|
if (filter.getLimit() != -1) {
|
||||||
sql += "ORDER BY ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY ";
|
sql += "OFFSET ? ROWS FETCH NEXT ? ROWS ONLY ";
|
||||||
}
|
}
|
||||||
sql += ") AS app_data ON app_data.ID = AP_APP.ID "
|
sql += ") AS app_data ON app_data.ID = AP_APP.ID "
|
||||||
+ "LEFT JOIN ("
|
+ "LEFT JOIN ("
|
||||||
@ -145,6 +146,7 @@ public class SQLServerApplicationDAOImpl extends GenericApplicationDAOImpl {
|
|||||||
Connection conn = this.getDBConnection();
|
Connection conn = this.getDBConnection();
|
||||||
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
|
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
|
||||||
int paramIndex = 1;
|
int paramIndex = 1;
|
||||||
|
stmt.setInt(paramIndex++, tenantId);
|
||||||
if (StringUtils.isNotEmpty(filter.getAppType()) && !Constants.ALL.equalsIgnoreCase(filter.getAppType())) {
|
if (StringUtils.isNotEmpty(filter.getAppType()) && !Constants.ALL.equalsIgnoreCase(filter.getAppType())) {
|
||||||
stmt.setString(paramIndex++, filter.getAppType());
|
stmt.setString(paramIndex++, filter.getAppType());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user