|
|
|
@ -47,8 +47,8 @@ public class ApplicationDAOImpl implements ApplicationDAO {
|
|
|
|
|
try {
|
|
|
|
|
conn = this.getConnection();
|
|
|
|
|
stmt = conn.prepareStatement("INSERT INTO DM_APPLICATION (NAME, PLATFORM, CATEGORY, " +
|
|
|
|
|
"VERSION, TYPE, LOCATION_URL, IMAGE_URL, TENANT_ID, APP_PROPERTIES, APP_IDENTIFIER, MEMORY_USAGE) " +
|
|
|
|
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
|
|
|
|
"VERSION, TYPE, LOCATION_URL, IMAGE_URL, TENANT_ID, APP_PROPERTIES, APP_IDENTIFIER, MEMORY_USAGE, IS_ACTIVE) " +
|
|
|
|
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
|
|
|
|
|
|
|
|
|
stmt.setString(1, application.getName());
|
|
|
|
|
stmt.setString(2, application.getPlatform());
|
|
|
|
@ -66,6 +66,7 @@ public class ApplicationDAOImpl implements ApplicationDAO {
|
|
|
|
|
|
|
|
|
|
stmt.setString(10, application.getApplicationIdentifier());
|
|
|
|
|
stmt.setInt(11, application.getMemoryUsage());
|
|
|
|
|
stmt.setBoolean(12, application.isActive());
|
|
|
|
|
stmt.execute();
|
|
|
|
|
|
|
|
|
|
rs = stmt.getGeneratedKeys();
|
|
|
|
@ -109,8 +110,8 @@ public class ApplicationDAOImpl implements ApplicationDAO {
|
|
|
|
|
try {
|
|
|
|
|
conn = this.getConnection();
|
|
|
|
|
stmt = conn.prepareStatement("INSERT INTO DM_APPLICATION (NAME, PLATFORM, CATEGORY, " +
|
|
|
|
|
"VERSION, TYPE, LOCATION_URL, IMAGE_URL, TENANT_ID,APP_PROPERTIES, APP_IDENTIFIER, MEMORY_USAGE) " +
|
|
|
|
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", new String[]{"id"});
|
|
|
|
|
"VERSION, TYPE, LOCATION_URL, IMAGE_URL, TENANT_ID,APP_PROPERTIES, APP_IDENTIFIER, MEMORY_USAGE, IS_ACTIVE) " +
|
|
|
|
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", new String[]{"id"});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Application application : applications) {
|
|
|
|
@ -131,6 +132,7 @@ public class ApplicationDAOImpl implements ApplicationDAO {
|
|
|
|
|
|
|
|
|
|
stmt.setString(10, application.getApplicationIdentifier());
|
|
|
|
|
stmt.setInt(11, application.getMemoryUsage());
|
|
|
|
|
stmt.setBoolean(12, application.isActive());
|
|
|
|
|
stmt.executeUpdate();
|
|
|
|
|
|
|
|
|
|
rs = stmt.getGeneratedKeys();
|
|
|
|
@ -208,7 +210,7 @@ public class ApplicationDAOImpl implements ApplicationDAO {
|
|
|
|
|
try {
|
|
|
|
|
conn = this.getConnection();
|
|
|
|
|
stmt = conn.prepareStatement("SELECT ID, NAME, APP_IDENTIFIER, PLATFORM, CATEGORY, VERSION, TYPE, " +
|
|
|
|
|
"LOCATION_URL, IMAGE_URL, APP_PROPERTIES, MEMORY_USAGE, TENANT_ID FROM DM_APPLICATION WHERE APP_IDENTIFIER = ? " +
|
|
|
|
|
"LOCATION_URL, IMAGE_URL, APP_PROPERTIES, MEMORY_USAGE, IS_ACTIVE, TENANT_ID FROM DM_APPLICATION WHERE APP_IDENTIFIER = ? " +
|
|
|
|
|
"AND TENANT_ID = ?");
|
|
|
|
|
stmt.setString(1, identifier);
|
|
|
|
|
stmt.setInt(2, tenantId);
|
|
|
|
@ -240,7 +242,7 @@ public class ApplicationDAOImpl implements ApplicationDAO {
|
|
|
|
|
try {
|
|
|
|
|
conn = this.getConnection();
|
|
|
|
|
stmt = conn.prepareStatement("Select ID, NAME, APP_IDENTIFIER, PLATFORM, CATEGORY, VERSION, TYPE, " +
|
|
|
|
|
"LOCATION_URL, IMAGE_URL, APP_PROPERTIES, MEMORY_USAGE, TENANT_ID From DM_APPLICATION app " +
|
|
|
|
|
"LOCATION_URL, IMAGE_URL, APP_PROPERTIES, MEMORY_USAGE, IS_ACTIVE, TENANT_ID From DM_APPLICATION app " +
|
|
|
|
|
"INNER JOIN " +
|
|
|
|
|
"(Select APPLICATION_ID From DM_DEVICE_APPLICATION_MAPPING WHERE DEVICE_ID=?) APPMAP " +
|
|
|
|
|
"ON " +
|
|
|
|
@ -287,6 +289,7 @@ public class ApplicationDAOImpl implements ApplicationDAO {
|
|
|
|
|
application.setPlatform(rs.getString("PLATFORM"));
|
|
|
|
|
application.setVersion(rs.getString("VERSION"));
|
|
|
|
|
application.setMemoryUsage(rs.getInt("MEMORY_USAGE"));
|
|
|
|
|
application.setActive(rs.getBoolean("IS_ACTIVE"));
|
|
|
|
|
application.setApplicationIdentifier(rs.getString("APP_IDENTIFIER"));
|
|
|
|
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|