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