Fixed EMM-1492

revert-70aa11f8
harshanl 8 years ago
parent e1c4305e73
commit d401741d9b

@ -73,18 +73,16 @@ public class EnrollmentDAOImpl implements EnrollmentDAO {
int status = -1; int status = -1;
try { try {
conn = this.getConnection(); conn = this.getConnection();
String sql = "UPDATE DM_ENROLMENT SET OWNERSHIP = ?, STATUS = ?, " + String sql = "UPDATE DM_ENROLMENT SET OWNERSHIP = ?, STATUS = ?, DATE_OF_LAST_UPDATE = ? WHERE DEVICE_ID = ?" +
"DATE_OF_ENROLMENT = ?, DATE_OF_LAST_UPDATE = ? WHERE DEVICE_ID = ? AND OWNER = ? AND TENANT_ID = ?" + " AND OWNER = ? AND TENANT_ID = ? AND ID = ?";
" AND ID = ?";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setString(1, enrolmentInfo.getOwnership().toString()); stmt.setString(1, enrolmentInfo.getOwnership().toString());
stmt.setString(2, enrolmentInfo.getStatus().toString()); stmt.setString(2, enrolmentInfo.getStatus().toString());
stmt.setTimestamp(3, new Timestamp(enrolmentInfo.getDateOfEnrolment())); stmt.setTimestamp(3, new Timestamp(new Date().getTime()));
stmt.setTimestamp(4, new Timestamp(new Date().getTime())); stmt.setInt(4, deviceId);
stmt.setInt(5, deviceId); stmt.setString(5, enrolmentInfo.getOwner());
stmt.setString(6, enrolmentInfo.getOwner()); stmt.setInt(6, tenantId);
stmt.setInt(7, tenantId); stmt.setInt(7, enrolmentInfo.getId());
stmt.setInt(8, enrolmentInfo.getId());
stmt.executeUpdate(); stmt.executeUpdate();
return status; return status;
} catch (SQLException e) { } catch (SQLException e) {
@ -102,14 +100,12 @@ public class EnrollmentDAOImpl implements EnrollmentDAO {
int status = -1; int status = -1;
try { try {
conn = this.getConnection(); conn = this.getConnection();
String sql = "UPDATE DM_ENROLMENT SET OWNERSHIP = ?, STATUS = ?, " + String sql = "UPDATE DM_ENROLMENT SET OWNERSHIP = ?, STATUS = ?, DATE_OF_LAST_UPDATE = ? WHERE ID = ?";
"DATE_OF_ENROLMENT = ?, DATE_OF_LAST_UPDATE = ? WHERE ID = ?";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setString(1, enrolmentInfo.getOwnership().toString()); stmt.setString(1, enrolmentInfo.getOwnership().toString());
stmt.setString(2, enrolmentInfo.getStatus().toString()); stmt.setString(2, enrolmentInfo.getStatus().toString());
stmt.setTimestamp(3, new Timestamp(enrolmentInfo.getDateOfEnrolment())); stmt.setTimestamp(3, new Timestamp(new Date().getTime()));
stmt.setTimestamp(4, new Timestamp(new Date().getTime())); stmt.setInt(4, enrolmentInfo.getId());
stmt.setInt(5, enrolmentInfo.getId());
stmt.executeUpdate(); stmt.executeUpdate();
return status; return status;
} catch (SQLException e) { } catch (SQLException e) {

Loading…
Cancel
Save