Fix h2 SQL syntax errors

feature/appm-store/pbac
lasanthaDLPDS 6 years ago
parent 4c9f0936b6
commit 8fa6abf697

@ -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"));

@ -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");

@ -155,19 +155,21 @@ public class ApplicationManagerImpl implements ApplicationManager {
applicationReleaseEntity.setBannerName(applicationArtifact.getBannername());
Map<String, InputStream> screenshots = applicationArtifact.getScreenshots();
List<String> scrrenshotnames = new ArrayList<>(screenshots.keySet());
List<String> 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(),

Loading…
Cancel
Save