stmt.setNull(4,Types.BLOB);// Assuming attachment column is of type BLOB
stmt.setNull(4,Types.BLOB);
}
stmt.setString(5,parametersJson);
@ -85,7 +85,8 @@ public class MailDAOImpl implements MailDAO {
@Override
publicList<MailModel>getUnsentMessages(){
Stringsql="SELECT * FROM EMAIL WHERE UUID NOT IN (SELECT UUID FROM SENTEMAIL)";//use expiry date and use left join for get the id
Stringsql="SELECT E.* FROM EMAIL E LEFT JOIN SENTEMAIL SE ON E.UUID = SE.UUID WHERE SE.UUID IS NULL AND (E.EXPIRY_AT IS NULL OR E.EXPIRY_AT > CURRENT_DATE)";
List<MailModel>unsentMails=newArrayList<>();
@ -103,7 +104,6 @@ public class MailDAOImpl implements MailDAO {