Fix ambigous column error

status
osh.silva 4 months ago
parent 770575999e
commit 748c28d368

@ -225,11 +225,11 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
try { try {
Connection conn = getConnection(); Connection conn = getConnection();
String sql = "SELECT d.ID AS DEVICE_ID, " + String sql = "SELECT d.ID AS DEVICE_ID, " +
"DEVICE_IDENTIFICATION, " + "d.DEVICE_IDENTIFICATION, " +
"DESCRIPTION, " + "DESCRIPTION, " +
"NAME, " + "NAME, " +
"DATE_OF_ENROLMENT, " + "DATE_OF_ENROLMENT, " +
"LAST_UPDATED_TIMESTAMP, " + "d.LAST_UPDATED_TIMESTAMP, " +
"STATUS, " + "STATUS, " +
"DATE_OF_LAST_UPDATE, " + "DATE_OF_LAST_UPDATE, " +
"TIMESTAMPDIFF(DAY, ?, DATE_OF_ENROLMENT) as DAYS_SINCE_ENROLLED " + "TIMESTAMPDIFF(DAY, ?, DATE_OF_ENROLMENT) as DAYS_SINCE_ENROLLED " +
@ -266,12 +266,12 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
try { try {
conn = this.getConnection(); conn = this.getConnection();
String sql = "select d.ID AS DEVICE_ID, " + String sql = "select d.ID AS DEVICE_ID, " +
"DEVICE_IDENTIFICATION, " + "d.DEVICE_IDENTIFICATION, " +
"DESCRIPTION, " + "DESCRIPTION, " +
"NAME, " + "NAME, " +
"DATE_OF_ENROLMENT, " + "DATE_OF_ENROLMENT, " +
"DATE_OF_LAST_UPDATE, " + "DATE_OF_LAST_UPDATE, " +
"d1.LAST_UPDATED_TIMESTAMP, " + "d.LAST_UPDATED_TIMESTAMP, " +
"STATUS, " + "STATUS, " +
"TIMESTAMPDIFF(DAY, DATE_OF_LAST_UPDATE, DATE_OF_ENROLMENT) AS DAYS_USED " + "TIMESTAMPDIFF(DAY, DATE_OF_LAST_UPDATE, DATE_OF_ENROLMENT) AS DAYS_USED " +
"from DM_DEVICE d, DM_ENROLMENT e " + "from DM_DEVICE d, DM_ENROLMENT e " +
@ -311,11 +311,11 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
try { try {
conn = this.getConnection(); conn = this.getConnection();
String sql = "select d.ID AS DEVICE_ID, " + String sql = "select d.ID AS DEVICE_ID, " +
"DEVICE_IDENTIFICATION, " + "d.DEVICE_IDENTIFICATION, " +
"DESCRIPTION, " + "DESCRIPTION, " +
"NAME, " + "NAME, " +
"DATE_OF_ENROLMENT, " + "DATE_OF_ENROLMENT, " +
"LAST_UPDATED_TIMESTAMP, " + "d.LAST_UPDATED_TIMESTAMP, " +
"STATUS, " + "STATUS, " +
"DATE_OF_LAST_UPDATE, " + "DATE_OF_LAST_UPDATE, " +
"TIMESTAMPDIFF(DAY, ?, ?) as DAYS_SINCE_ENROLLED " + "TIMESTAMPDIFF(DAY, ?, ?) as DAYS_SINCE_ENROLLED " +
@ -352,12 +352,12 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
try { try {
conn = this.getConnection(); conn = this.getConnection();
String sql = "select d.ID AS DEVICE_ID, " + String sql = "select d.ID AS DEVICE_ID, " +
"DEVICE_IDENTIFICATION, " + "d.DEVICE_IDENTIFICATION, " +
"DESCRIPTION, " + "DESCRIPTION, " +
"NAME, " + "NAME, " +
"DATE_OF_ENROLMENT, " + "DATE_OF_ENROLMENT, " +
"DATE_OF_LAST_UPDATE, " + "DATE_OF_LAST_UPDATE, " +
"LAST_UPDATED_TIMESTAMP, " + "d.LAST_UPDATED_TIMESTAMP, " +
"STATUS, " + "STATUS, " +
"TIMESTAMPDIFF(DAY, DATE_OF_LAST_UPDATE, ?) AS DAYS_USED " + "TIMESTAMPDIFF(DAY, DATE_OF_LAST_UPDATE, ?) AS DAYS_USED " +
"from DM_DEVICE d, DM_ENROLMENT e " + "from DM_DEVICE d, DM_ENROLMENT e " +
@ -400,9 +400,9 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
conn = this.getConnection(); conn = this.getConnection();
String sql = "SELECT " + String sql = "SELECT " +
"DM_DEVICE.ID AS DEVICE_ID, " + "DM_DEVICE.ID AS DEVICE_ID, " +
"DEVICE_IDENTIFICATION, " + "d.DEVICE_IDENTIFICATION, " +
"DESCRIPTION, " + "DESCRIPTION, " +
"LAST_UPDATED_TIMESTAMP, " + "d.LAST_UPDATED_TIMESTAMP, " +
"DM_DEVICE.NAME AS DEVICE_NAME, " + "DM_DEVICE.NAME AS DEVICE_NAME, " +
"DEVICE_TYPE, " + "DEVICE_TYPE, " +
"DM_ENROLMENT.ID AS ENROLMENT_ID, " + "DM_ENROLMENT.ID AS ENROLMENT_ID, " +

@ -2233,8 +2233,6 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
String msg = "Error occurred while opening a connection to the data source"; String msg = "Error occurred while opening a connection to the data source";
log.info(msg, e); log.info(msg, e);
throw new DeviceManagementException(msg, e); throw new DeviceManagementException(msg, e);
} finally {
DeviceManagementDAOFactory.closeConnection();
} }
} }

Loading…
Cancel
Save