Add fix for error when searching app with AppType with ALL filter

apptypeallfix
prathabanKavin 2 years ago
parent 9b9d15cacb
commit 8b9241e4b5

@ -149,7 +149,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
} }
sql += "WHERE AP_APP.TENANT_ID = ? "; sql += "WHERE AP_APP.TENANT_ID = ? ";
if (StringUtils.isNotEmpty(filter.getAppType())) { if (StringUtils.isNotEmpty(filter.getAppType()) && !filter.getAppType().equalsIgnoreCase("ALL")) {
sql += "AND AP_APP.TYPE = ? "; sql += "AND AP_APP.TYPE = ? ";
} }
if (StringUtils.isNotEmpty(filter.getAppName())) { if (StringUtils.isNotEmpty(filter.getAppName())) {
@ -204,7 +204,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
try (PreparedStatement stmt = conn.prepareStatement(sql)) { try (PreparedStatement stmt = conn.prepareStatement(sql)) {
int paramIndex = 1; int paramIndex = 1;
stmt.setInt(paramIndex++, tenantId); stmt.setInt(paramIndex++, tenantId);
if (StringUtils.isNotEmpty(filter.getAppType())) { if (StringUtils.isNotEmpty(filter.getAppType()) && !filter.getAppType().equalsIgnoreCase("ALL")) {
stmt.setString(paramIndex++, filter.getAppType()); stmt.setString(paramIndex++, filter.getAppType());
} }
if (StringUtils.isNotEmpty(filter.getAppName())) { if (StringUtils.isNotEmpty(filter.getAppName())) {

@ -94,7 +94,7 @@ public class OracleApplicationDAOImpl 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 ";
} }
if (StringUtils.isNotEmpty(filter.getAppType())) { if (StringUtils.isNotEmpty(filter.getAppType()) && !filter.getAppType().equalsIgnoreCase("ALL")) {
sql += "AND AP_APP.TYPE = ? "; sql += "AND AP_APP.TYPE = ? ";
} }
if (StringUtils.isNotEmpty(filter.getAppName())) { if (StringUtils.isNotEmpty(filter.getAppName())) {
@ -145,7 +145,7 @@ public class OracleApplicationDAOImpl 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;
if (StringUtils.isNotEmpty(filter.getAppType())) { if (StringUtils.isNotEmpty(filter.getAppType()) && !filter.getAppType().equalsIgnoreCase("ALL")) {
stmt.setString(paramIndex++, filter.getAppType()); stmt.setString(paramIndex++, filter.getAppType());
} }
if (StringUtils.isNotEmpty(filter.getAppName())) { if (StringUtils.isNotEmpty(filter.getAppName())) {

@ -93,7 +93,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 ";
} }
if (StringUtils.isNotEmpty(filter.getAppType())) { if (StringUtils.isNotEmpty(filter.getAppType()) && !filter.getAppType().equalsIgnoreCase("ALL")) {
sql += "AND AP_APP.TYPE = ? "; sql += "AND AP_APP.TYPE = ? ";
} }
if (StringUtils.isNotEmpty(filter.getAppName())) { if (StringUtils.isNotEmpty(filter.getAppName())) {
@ -144,7 +144,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;
if (StringUtils.isNotEmpty(filter.getAppType())) { if (StringUtils.isNotEmpty(filter.getAppType()) && !filter.getAppType().equalsIgnoreCase("ALL")) {
stmt.setString(paramIndex++, filter.getAppType()); stmt.setString(paramIndex++, filter.getAppType());
} }
if (StringUtils.isNotEmpty(filter.getAppName())) { if (StringUtils.isNotEmpty(filter.getAppName())) {

@ -2931,8 +2931,9 @@ public class ApplicationManagerImpl implements ApplicationManager {
if (!StringUtils.isEmpty(appType)) { if (!StringUtils.isEmpty(appType)) {
boolean isValidAppType = false; boolean isValidAppType = false;
String appTypeAll = "ALL";
for (ApplicationType applicationType : ApplicationType.values()) { for (ApplicationType applicationType : ApplicationType.values()) {
if (applicationType.toString().equalsIgnoreCase(appType)) { if (applicationType.toString().equalsIgnoreCase(appType) || appTypeAll.equalsIgnoreCase(appType)) {
isValidAppType = true; isValidAppType = true;
break; break;
} }

Loading…
Cancel
Save