diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/common/Util.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/common/Util.java index bc564ca7e1..bb1fc705eb 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/common/Util.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/common/Util.java @@ -151,7 +151,7 @@ public class Util { appRelease.setScreenshotName2("RELEASE_SC2"); appRelease.setScreenshotName3("RELEASE_SC3"); appRelease.setPrice(rs.getDouble(" RELEASE_PRICE")); - appRelease.setMetaData(rs.getString("RELEASE.META_INFO")); + appRelease.setMetaData(rs.getString("RELEASE_META_INFO")); appRelease.setSupportedOsVersions(rs.getString("RELEASE_SUP_OS_VERSIONS")); appRelease.setRating(rs.getDouble("RELEASE_RATING")); appRelease.setCurrentState(rs.getString("RELEASE_CURRENT_STATE")); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java index 5b7ba8c60e..213926a6c5 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java @@ -268,16 +268,16 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic + "AP_APP_RELEASE.SC_2_LOCATION AS AP_RELEASE_SC2, " + "AP_APP_RELEASE.SC_3_LOCATION AS AP_RELEASE_SC3, " + "AP_APP_RELEASE.APP_PRICE AS RELEASE_PRICE, " - + "AP_APP_RELEASE.APP_META_INFO AS RELEASE.META_INFO, " + + "AP_APP_RELEASE.APP_META_INFO AS RELEASE_META_INFO, " + "AP_APP_RELEASE.SUPPORTED_OS_VERSIONS AS RELEASE_SUP_OS_VERSIONS, " + "AP_APP_RELEASE.RATING AS RELEASE_RATING, " + "AP_APP_RELEASE.CURRENT_STATE AS RELEASE_CURRENT_STATE, " + "AP_APP_RELEASE.RATED_USERS AS RATED_USER_COUNT " + "FROM AP_APP " + "INNER JOIN AP_APP_RELEASE ON " - + "APP_APP.ID = APP_APP_RELEASE.AP_APP_ID AND " + + "AP_APP.ID = AP_APP_RELEASE.AP_APP_ID AND " + "AP_APP.TENANT_ID = ? AND " - + "AP_APP.TENANT_ID = APP_APP_RELEASE.TENANT_ID"; + + "AP_APP.TENANT_ID = AP_APP_RELEASE.TENANT_ID"; if (filter == null) { throw new ApplicationManagementDAOException("Filter need to be instantiated"); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java index 0b1298e4dd..527e08b352 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java @@ -155,19 +155,21 @@ public class ApplicationManagerImpl implements ApplicationManager { applicationReleaseEntity.setBannerName(applicationArtifact.getBannername()); Map screenshots = applicationArtifact.getScreenshots(); - List scrrenshotnames = new ArrayList<>(screenshots.keySet()); + List screenshotNames = new ArrayList<>(screenshots.keySet()); - for (int i = 1; i <= scrrenshotnames.size(); i++) { - if (i == 1) { - applicationReleaseEntity.setScreenshotName1(scrrenshotnames.get(i)); - } else if (i == 2) { - applicationReleaseEntity.setScreenshotName2(scrrenshotnames.get(i)); - - } else if (i == 3) { - applicationReleaseEntity.setScreenshotName3(scrrenshotnames.get(i)); + int counter = 1; + for (String scName : screenshotNames) { + if (counter == 1) { + applicationReleaseEntity.setScreenshotName1(scName); + } else if (counter == 2) { + applicationReleaseEntity.setScreenshotName2(scName); + } else if (counter == 3) { + applicationReleaseEntity.setScreenshotName3(scName); } + counter++; } + // Upload images applicationReleaseEntity = applicationStorageManager .uploadImageArtifacts(applicationReleaseEntity, applicationArtifact.getIconStream(),