|
|
@ -63,10 +63,10 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
|
|
|
PreparedStatement statement = null;
|
|
|
|
PreparedStatement statement = null;
|
|
|
|
ResultSet resultSet = null;
|
|
|
|
ResultSet resultSet = null;
|
|
|
|
|
|
|
|
|
|
|
|
String sql = "INSERT INTO AP_APP_RELEASE (VERSION,TENANT_ID,UUID,RELEASE_TYPE,APP_PRICE,STORED_LOCATION, "
|
|
|
|
String sql = "INSERT INTO AP_APP_RELEASE (VERSION,TENANT_ID,UUID,RELEASE_TYPE, PACKAGE_NAME, APP_PRICE,"
|
|
|
|
+ "BANNER_LOCATION, SC_1_LOCATION,SC_2_LOCATION,SC_3_LOCATION, APP_HASH_VALUE,SHARED_WITH_ALL_TENANTS, "
|
|
|
|
+ "STORED_LOCATION, BANNER_LOCATION, SC_1_LOCATION,SC_2_LOCATION,SC_3_LOCATION, APP_HASH_VALUE,"
|
|
|
|
+ "APP_META_INFO,CREATED_BY,AP_APP_ID) VALUES "
|
|
|
|
+ "SHARED_WITH_ALL_TENANTS, APP_META_INFO,CREATED_BY,AP_APP_ID) "
|
|
|
|
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?);";
|
|
|
|
+ "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);";
|
|
|
|
|
|
|
|
|
|
|
|
int index = 0;
|
|
|
|
int index = 0;
|
|
|
|
String generatedColumns[] = {"ID"};
|
|
|
|
String generatedColumns[] = {"ID"};
|
|
|
@ -77,6 +77,7 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
|
|
|
statement.setInt(++index, tenantId);
|
|
|
|
statement.setInt(++index, tenantId);
|
|
|
|
statement.setString(++index, applicationRelease.getUuid());
|
|
|
|
statement.setString(++index, applicationRelease.getUuid());
|
|
|
|
statement.setString(++index, String.valueOf(applicationRelease.getReleaseType()));
|
|
|
|
statement.setString(++index, String.valueOf(applicationRelease.getReleaseType()));
|
|
|
|
|
|
|
|
statement.setString(++index, String.valueOf(applicationRelease.getPackageName()));
|
|
|
|
statement.setDouble(++index, applicationRelease.getPrice());
|
|
|
|
statement.setDouble(++index, applicationRelease.getPrice());
|
|
|
|
statement.setString(++index, applicationRelease.getAppStoredLoc());
|
|
|
|
statement.setString(++index, applicationRelease.getAppStoredLoc());
|
|
|
|
statement.setString(++index, applicationRelease.getScreenshotLoc1());
|
|
|
|
statement.setString(++index, applicationRelease.getScreenshotLoc1());
|
|
|
@ -121,14 +122,15 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
|
|
|
Connection connection;
|
|
|
|
Connection connection;
|
|
|
|
PreparedStatement statement = null;
|
|
|
|
PreparedStatement statement = null;
|
|
|
|
ResultSet resultSet = null;
|
|
|
|
ResultSet resultSet = null;
|
|
|
|
String sql = "SELECT AR.ID AS RELESE_ID, AR.VERSION AS RELEASE_VERSION, AR.UUID, AR.RELEASE_TYPE, AR.APP_PRICE,"
|
|
|
|
String sql = "SELECT AR.ID AS RELESE_ID, AR.VERSION AS RELEASE_VERSION, AR.UUID, AR.RELEASE_TYPE, "
|
|
|
|
+ " AR.STORED_LOCATION, AR.BANNER_LOCATION, AR.SC_1_LOCATION AS SCREEN_SHOT_1, "
|
|
|
|
+ "AR.PACKAGE_NAME AS PACKAGE_NAME, AR.APP_PRICE, AR.STORED_LOCATION, AR.BANNER_LOCATION, "
|
|
|
|
+ "AR.SC_2_LOCATION AS SCREEN_SHOT_2, AR.SC_3_LOCATION AS SCREEN_SHOT_3, AR.APP_HASH_VALUE AS HASH_VALUE, "
|
|
|
|
+ "AR.SC_1_LOCATION AS SCREEN_SHOT_1, AR.SC_2_LOCATION AS SCREEN_SHOT_2, AR.SC_3_LOCATION AS "
|
|
|
|
+ "AR.SHARED_WITH_ALL_TENANTS AS SHARED, AR.APP_META_INFO, AR.CREATED_BY, AR.CREATED_AT, AR.PUBLISHED_BY, "
|
|
|
|
+ "SCREEN_SHOT_3, AR.APP_HASH_VALUE AS HASH_VALUE, AR.SHARED_WITH_ALL_TENANTS AS SHARED, "
|
|
|
|
+ "AR.PUBLISHED_AT, AR.STARS, AL.CURRENT_STATE, AL.PREVIOUSE_STATE, AL.UPDATED_BY, AL.UPDATED_AT FROM "
|
|
|
|
+ "AR.APP_META_INFO, AR.CREATED_BY, AR.CREATED_AT, AR.PUBLISHED_BY, AR.PUBLISHED_AT, AR.STARS, "
|
|
|
|
+ "AP_APP_RELEASE AS AR, AP_APP_LIFECYCLE_STATE AS AL "
|
|
|
|
+ "AL.CURRENT_STATE, AL.PREVIOUSE_STATE, AL.UPDATED_BY, AL.UPDATED_AT FROM "
|
|
|
|
+ "WHERE AR.AP_APP_ID=(SELECT ID FROM AP_APP WHERE NAME=? AND TYPE=? AND TENANT_ID=?)"
|
|
|
|
+ "AP_APP_RELEASE AS AR, AP_APP_LIFECYCLE_STATE AS AL WHERE "
|
|
|
|
+ " AND AR.VERSION=? AND AR.RELEASE_TYPE=? AND AL.AP_APP_RELEASE_ID=AR.ID "
|
|
|
|
+ "AR.AP_APP_ID=(SELECT ID FROM AP_APP WHERE NAME=? AND TYPE=? AND TENANT_ID=?) "
|
|
|
|
|
|
|
|
+ "AND AR.VERSION=? AND AR.RELEASE_TYPE=? AND AL.AP_APP_RELEASE_ID=AR.ID "
|
|
|
|
+ "AND AL.TENANT_ID=AR.TENANT_ID ORDER BY AL.UPDATED_AT DESC;";
|
|
|
|
+ "AND AL.TENANT_ID=AR.TENANT_ID ORDER BY AL.UPDATED_AT DESC;";
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -350,27 +352,29 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
|
|
|
throws ApplicationManagementDAOException {
|
|
|
|
throws ApplicationManagementDAOException {
|
|
|
|
Connection connection;
|
|
|
|
Connection connection;
|
|
|
|
PreparedStatement statement = null;
|
|
|
|
PreparedStatement statement = null;
|
|
|
|
String sql = "UPDATE AP_APP_RELEASE SET VERSION = ? AND UUID = ? AND RELEASE_TYPE = ? AND APP_PRICE = ? AND " +
|
|
|
|
String sql = "UPDATE AP_APP_RELEASE SET VERSION = ? AND UUID = ? AND RELEASE_TYPE = ? AND PACKAGE_NAME = ? "
|
|
|
|
"STORED_LOCATION = ? AND BANNER_LOCATION = ? AND SC_1_LOCATION = ? AND SC_2_LOCATION = ? AND " +
|
|
|
|
+ "AND APP_PRICE = ? AND STORED_LOCATION = ? AND BANNER_LOCATION = ? AND SC_1_LOCATION = ? "
|
|
|
|
"SC_3_LOCATION = ? AND APP_HASH_VALUE = ? AND SHARED_WITH_ALL_TENANTS = ? AND APP_META_INFO = ? AND " +
|
|
|
|
+ "AND SC_2_LOCATION = ? AND SC_3_LOCATION = ? AND APP_HASH_VALUE = ? AND SHARED_WITH_ALL_TENANTS = ? "
|
|
|
|
"CREATED_BY = ? AND CREATED_AT = ? WHERE AP_APP_ID = ? AND TENANT_ID = ? AND ID = ?;";
|
|
|
|
+ "AND APP_META_INFO = ? AND CREATED_BY = ? AND CREATED_AT = ? WHERE AP_APP_ID = ? AND TENANT_ID = ? "
|
|
|
|
|
|
|
|
+ "AND ID = ?;";
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
connection = this.getDBConnection();
|
|
|
|
connection = this.getDBConnection();
|
|
|
|
statement = connection.prepareStatement(sql);
|
|
|
|
statement = connection.prepareStatement(sql);
|
|
|
|
statement.setString(1, applicationRelease.getVersion());
|
|
|
|
statement.setString(1, applicationRelease.getVersion());
|
|
|
|
statement.setString(2, applicationRelease.getUuid());
|
|
|
|
statement.setString(2, applicationRelease.getUuid());
|
|
|
|
statement.setString(3, applicationRelease.getReleaseType());
|
|
|
|
statement.setString(3, applicationRelease.getReleaseType());
|
|
|
|
statement.setDouble(4, applicationRelease.getPrice());
|
|
|
|
statement.setString(4, applicationRelease.getPackageName());
|
|
|
|
statement.setString(5, applicationRelease.getAppStoredLoc());
|
|
|
|
statement.setDouble(5, applicationRelease.getPrice());
|
|
|
|
statement.setString(6, applicationRelease.getBannerLoc());
|
|
|
|
statement.setString(6, applicationRelease.getAppStoredLoc());
|
|
|
|
statement.setString(7, applicationRelease.getScreenshotLoc1());
|
|
|
|
statement.setString(7, applicationRelease.getBannerLoc());
|
|
|
|
statement.setString(8, applicationRelease.getScreenshotLoc2());
|
|
|
|
statement.setString(8, applicationRelease.getScreenshotLoc1());
|
|
|
|
statement.setString(9, applicationRelease.getScreenshotLoc3());
|
|
|
|
statement.setString(9, applicationRelease.getScreenshotLoc2());
|
|
|
|
statement.setString(10, applicationRelease.getAppHashValue());
|
|
|
|
statement.setString(10, applicationRelease.getScreenshotLoc3());
|
|
|
|
statement.setInt(11, applicationRelease.getIsSharedWithAllTenants());
|
|
|
|
statement.setString(11, applicationRelease.getAppHashValue());
|
|
|
|
statement.setString(12, applicationRelease.getMetaData());
|
|
|
|
statement.setInt(12, applicationRelease.getIsSharedWithAllTenants());
|
|
|
|
statement.setString(13, applicationRelease.getApplicationCreator());
|
|
|
|
statement.setString(13, applicationRelease.getMetaData());
|
|
|
|
statement.setTimestamp(14, new Timestamp(System.currentTimeMillis()));
|
|
|
|
statement.setString(14, applicationRelease.getApplicationCreator());
|
|
|
|
|
|
|
|
statement.setTimestamp(15, new Timestamp(System.currentTimeMillis()));
|
|
|
|
statement.executeUpdate();
|
|
|
|
statement.executeUpdate();
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
throw new ApplicationManagementDAOException(
|
|
|
|
throw new ApplicationManagementDAOException(
|
|
|
@ -425,6 +429,7 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
|
|
|
|
applicationRelease.setVersion(resultSet.getString("RELEASE_VERSION"));
|
|
|
|
applicationRelease.setVersion(resultSet.getString("RELEASE_VERSION"));
|
|
|
|
applicationRelease.setUuid(resultSet.getString("UUID"));
|
|
|
|
applicationRelease.setUuid(resultSet.getString("UUID"));
|
|
|
|
applicationRelease.setReleaseType(resultSet.getString("RELEASE_TYPE"));
|
|
|
|
applicationRelease.setReleaseType(resultSet.getString("RELEASE_TYPE"));
|
|
|
|
|
|
|
|
applicationRelease.setPackageName(resultSet.getString("PACKAGE_NAME"));
|
|
|
|
applicationRelease.setPrice(resultSet.getDouble("APP_PRICE"));
|
|
|
|
applicationRelease.setPrice(resultSet.getDouble("APP_PRICE"));
|
|
|
|
applicationRelease.setAppStoredLoc(resultSet.getString("STORED_LOCATION"));
|
|
|
|
applicationRelease.setAppStoredLoc(resultSet.getString("STORED_LOCATION"));
|
|
|
|
applicationRelease.setBannerLoc(resultSet.getString("BANNER_LOCATION"));
|
|
|
|
applicationRelease.setBannerLoc(resultSet.getString("BANNER_LOCATION"));
|
|
|
|