|
|
@ -42,7 +42,7 @@ public class EnrollmentDAOImpl implements EnrollmentDAO {
|
|
|
|
conn = this.getConnection();
|
|
|
|
conn = this.getConnection();
|
|
|
|
String sql = "INSERT INTO DM_ENROLMENT(DEVICE_ID, OWNER, OWNERSHIP, STATUS, " +
|
|
|
|
String sql = "INSERT INTO DM_ENROLMENT(DEVICE_ID, OWNER, OWNERSHIP, STATUS, " +
|
|
|
|
"DATE_OF_ENROLMENT, DATE_OF_LAST_UPDATE, TENANT_ID) VALUES(?, ?, ?, ?, ?, ?, ?)";
|
|
|
|
"DATE_OF_ENROLMENT, DATE_OF_LAST_UPDATE, TENANT_ID) VALUES(?, ?, ?, ?, ?, ?, ?)";
|
|
|
|
stmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
|
|
|
|
stmt = conn.prepareStatement(sql, new String[] {"id"});
|
|
|
|
stmt.setInt(1, deviceId);
|
|
|
|
stmt.setInt(1, deviceId);
|
|
|
|
stmt.setString(2, enrolmentInfo.getOwner());
|
|
|
|
stmt.setString(2, enrolmentInfo.getOwner());
|
|
|
|
stmt.setString(3, enrolmentInfo.getOwnership().toString());
|
|
|
|
stmt.setString(3, enrolmentInfo.getOwnership().toString());
|
|
|
@ -76,7 +76,7 @@ public class EnrollmentDAOImpl implements EnrollmentDAO {
|
|
|
|
String sql = "UPDATE DM_ENROLMENT SET OWNERSHIP = ?, STATUS = ?, " +
|
|
|
|
String sql = "UPDATE DM_ENROLMENT SET OWNERSHIP = ?, STATUS = ?, " +
|
|
|
|
"DATE_OF_ENROLMENT = ?, DATE_OF_LAST_UPDATE = ? WHERE DEVICE_ID = ? AND OWNER = ? AND TENANT_ID = ?" +
|
|
|
|
"DATE_OF_ENROLMENT = ?, DATE_OF_LAST_UPDATE = ? WHERE DEVICE_ID = ? AND OWNER = ? AND TENANT_ID = ?" +
|
|
|
|
" AND ID = ?";
|
|
|
|
" AND ID = ?";
|
|
|
|
stmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
|
|
|
|
stmt = conn.prepareStatement(sql, new String[] {"id"});
|
|
|
|
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(enrolmentInfo.getDateOfEnrolment()));
|
|
|
@ -109,7 +109,7 @@ public class EnrollmentDAOImpl implements EnrollmentDAO {
|
|
|
|
conn = this.getConnection();
|
|
|
|
conn = this.getConnection();
|
|
|
|
String sql = "UPDATE DM_ENROLMENT SET OWNERSHIP = ?, STATUS = ?, " +
|
|
|
|
String sql = "UPDATE DM_ENROLMENT SET OWNERSHIP = ?, STATUS = ?, " +
|
|
|
|
"DATE_OF_ENROLMENT = ?, DATE_OF_LAST_UPDATE = ? WHERE ID = ?";
|
|
|
|
"DATE_OF_ENROLMENT = ?, DATE_OF_LAST_UPDATE = ? WHERE ID = ?";
|
|
|
|
stmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
|
|
|
|
stmt = conn.prepareStatement(sql, new String[] {"id"});
|
|
|
|
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(enrolmentInfo.getDateOfEnrolment()));
|
|
|
@ -140,7 +140,7 @@ public class EnrollmentDAOImpl implements EnrollmentDAO {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
conn = this.getConnection();
|
|
|
|
conn = this.getConnection();
|
|
|
|
String sql = "DELETE DM_ENROLMENT WHERE DEVICE_ID = ? AND OWNER = ? AND TENANT_ID = ?";
|
|
|
|
String sql = "DELETE DM_ENROLMENT WHERE DEVICE_ID = ? AND OWNER = ? AND TENANT_ID = ?";
|
|
|
|
stmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
|
|
|
|
stmt = conn.prepareStatement(sql, new String[] {"id"});
|
|
|
|
stmt.setInt(1, deviceId);
|
|
|
|
stmt.setInt(1, deviceId);
|
|
|
|
stmt.setString(2, currentOwner);
|
|
|
|
stmt.setString(2, currentOwner);
|
|
|
|
stmt.setInt(3, tenantId);
|
|
|
|
stmt.setInt(3, tenantId);
|
|
|
|