Android DeviceDAO layer fixes added

revert-dabc3590
harshanL 10 years ago
parent f75aa4e1c8
commit a6a1f1aaf3

@ -60,7 +60,7 @@ public class AndroidDeviceDAOImpl implements MobileDeviceDAO{
String selectDBQuery = String selectDBQuery =
"SELECT ANDROID_DEVICE_ID, GCM_TOKEN, DEVICE_INFO, SERIAL, VENDOR, MAC_ADDRESS, " + "SELECT ANDROID_DEVICE_ID, GCM_TOKEN, DEVICE_INFO, SERIAL, VENDOR, MAC_ADDRESS, " +
"DEVICE_NAME, LATITUDE, LONGITUDE, IMEI, IMSI, 0S_VERSION FROM AD_DEVICE WHERE" + "DEVICE_NAME, LATITUDE, LONGITUDE, IMEI, IMSI, 0S_VERSION FROM AD_DEVICE WHERE" +
" MOBILE_DEVICE_ID = ?"; " ANDROID_DEVICE_ID = ?";
stmt = conn.prepareStatement(selectDBQuery); stmt = conn.prepareStatement(selectDBQuery);
stmt.setString(1, mblDeviceId); stmt.setString(1, mblDeviceId);
ResultSet resultSet = stmt.executeQuery(); ResultSet resultSet = stmt.executeQuery();
@ -186,35 +186,35 @@ public class AndroidDeviceDAOImpl implements MobileDeviceDAO{
"WHERE ANDROID_DEVICE_ID = ?"; "WHERE ANDROID_DEVICE_ID = ?";
stmt = conn.prepareStatement(updateDBQuery); stmt = conn.prepareStatement(updateDBQuery);
stmt.setString(1, mobileDevice.getMobileDeviceId());
if (mobileDevice.getDeviceProperties() == null) { if (mobileDevice.getDeviceProperties() == null) {
mobileDevice.setDeviceProperties(new HashMap<String, String>()); mobileDevice.setDeviceProperties(new HashMap<String, String>());
} }
stmt.setString(2, AndroidUtils.getDeviceProperty( stmt.setString(1, AndroidUtils.getDeviceProperty(
mobileDevice.getDeviceProperties(), mobileDevice.getDeviceProperties(),
AndroidPluginConstants.GCM_TOKEN)); AndroidPluginConstants.GCM_TOKEN));
stmt.setString(3, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(), stmt.setString(2, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(),
AndroidPluginConstants.DEVICE_INFO)); AndroidPluginConstants.DEVICE_INFO));
stmt.setString(4, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(), stmt.setString(3, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(),
AndroidPluginConstants.SERIAL)); AndroidPluginConstants.SERIAL));
stmt.setString(5, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(), stmt.setString(4, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(),
AndroidPluginConstants.VENDOR)); AndroidPluginConstants.VENDOR));
stmt.setString(6, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(), stmt.setString(5, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(),
AndroidPluginConstants.MAC_ADDRESS)); AndroidPluginConstants.MAC_ADDRESS));
stmt.setString(7, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(), stmt.setString(6, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(),
AndroidPluginConstants.DEVICE_NAME)); AndroidPluginConstants.DEVICE_NAME));
stmt.setString(8, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(), stmt.setString(7, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(),
AndroidPluginConstants.LATITUDE)); AndroidPluginConstants.LATITUDE));
stmt.setString(9, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(), stmt.setString(8, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(),
AndroidPluginConstants.LONGITUDE)); AndroidPluginConstants.LONGITUDE));
stmt.setString(10, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(), stmt.setString(9, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(),
AndroidPluginConstants.IMEI)); AndroidPluginConstants.IMEI));
stmt.setString(11, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(), stmt.setString(10, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(),
AndroidPluginConstants.IMSI)); AndroidPluginConstants.IMSI));
stmt.setString(12, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(), stmt.setString(11, AndroidUtils.getDeviceProperty(mobileDevice.getDeviceProperties(),
AndroidPluginConstants.OS_VERSION)); AndroidPluginConstants.OS_VERSION));
stmt.setString(12, mobileDevice.getMobileDeviceId());
int rows = stmt.executeUpdate(); int rows = stmt.executeUpdate();
if (rows > 0) { if (rows > 0) {
status = true; status = true;

Loading…
Cancel
Save