diff --git a/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java b/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java index 53dc2568..0225deba 100644 --- a/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java +++ b/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java @@ -64,9 +64,9 @@ public void addNotificationTemplate(NotificationTemplate notificationTemplate, S namedJdbcTemplate.executeInsert(INSERT_APP_NOTIFICATION_TEMPLATE_SQL, (preparedStatement -> { preparedStatement.setString(TEMPLATE_KEY, locale.toLowerCase()); preparedStatement.setString(LOCALE, locale); - preparedStatement.setString(SUBJECT, notificationTemplate.getSubject()); - preparedStatement.setString(BODY, notificationTemplate.getBody()); - preparedStatement.setString(FOOTER, notificationTemplate.getFooter()); + preparedStatement.setNString(3, notificationTemplate.getSubject()); + preparedStatement.setNString(4, notificationTemplate.getBody()); + preparedStatement.setNString(5, notificationTemplate.getFooter()); preparedStatement.setString(CONTENT_TYPE, notificationTemplate.getContentType()); preparedStatement.setString(TYPE_KEY, displayName.toLowerCase()); preparedStatement.setString(CHANNEL, channelName); @@ -93,9 +93,9 @@ public NotificationTemplate getNotificationTemplate(String locale, String templa notificationTemplate = namedJdbcTemplate.fetchSingleRecord(GET_APP_NOTIFICATION_TEMPLATE_SQL, (resultSet, rowNumber) -> { NotificationTemplate notificationTemplateResult = new NotificationTemplate(); - notificationTemplateResult.setSubject(resultSet.getString(SUBJECT)); - notificationTemplateResult.setBody(resultSet.getString(BODY)); - notificationTemplateResult.setFooter(resultSet.getString(FOOTER)); + notificationTemplateResult.setSubject(resultSet.getNString(SUBJECT)); + notificationTemplateResult.setBody(resultSet.getNString(BODY)); + notificationTemplateResult.setFooter(resultSet.getNString(FOOTER)); notificationTemplateResult.setContentType(resultSet.getString(CONTENT_TYPE)); notificationTemplateResult.setLocale(locale); notificationTemplateResult.setType(templateType); @@ -175,9 +175,9 @@ public List listNotificationTemplates(String templateType, notificationTemplates = namedJdbcTemplate.executeQuery(LIST_APP_NOTIFICATION_TEMPLATES_BY_APP_SQL, (resultSet, rowNumber) -> { NotificationTemplate notificationTemplateResult = new NotificationTemplate(); - notificationTemplateResult.setSubject(resultSet.getString(SUBJECT)); - notificationTemplateResult.setBody(resultSet.getString(BODY)); - notificationTemplateResult.setFooter(resultSet.getString(FOOTER)); + notificationTemplateResult.setSubject(resultSet.getNString(SUBJECT)); + notificationTemplateResult.setBody(resultSet.getNString(BODY)); + notificationTemplateResult.setFooter(resultSet.getNString(FOOTER)); notificationTemplateResult.setContentType(resultSet.getString(CONTENT_TYPE)); notificationTemplateResult.setLocale(resultSet.getString(LOCALE)); notificationTemplateResult.setType(templateType.toLowerCase()); @@ -212,9 +212,9 @@ public void updateNotificationTemplate(NotificationTemplate notificationTemplate try { namedJdbcTemplate.executeUpdate(UPDATE_APP_NOTIFICATION_TEMPLATE_SQL, preparedStatement -> { - preparedStatement.setString(SUBJECT, notificationTemplate.getSubject()); - preparedStatement.setString(BODY, notificationTemplate.getBody()); - preparedStatement.setString(FOOTER, notificationTemplate.getFooter()); + preparedStatement.setNString(1, notificationTemplate.getSubject()); + preparedStatement.setNString(2, notificationTemplate.getBody()); + preparedStatement.setNString(3, notificationTemplate.getFooter()); preparedStatement.setString(CONTENT_TYPE, notificationTemplate.getContentType()); preparedStatement.setString(TEMPLATE_KEY, locale.toLowerCase()); preparedStatement.setString(TYPE_KEY, displayName.toLowerCase()); diff --git a/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/OrgNotificationTemplateDAO.java b/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/OrgNotificationTemplateDAO.java index d14c0699..39b28a01 100644 --- a/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/OrgNotificationTemplateDAO.java +++ b/components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/OrgNotificationTemplateDAO.java @@ -63,9 +63,9 @@ public void addNotificationTemplate(NotificationTemplate notificationTemplate, i namedJdbcTemplate.executeInsert(INSERT_ORG_NOTIFICATION_TEMPLATE_SQL, (preparedStatement -> { preparedStatement.setString(TEMPLATE_KEY, locale.toLowerCase()); preparedStatement.setString(LOCALE, locale); - preparedStatement.setString(SUBJECT, notificationTemplate.getSubject()); - preparedStatement.setString(BODY, notificationTemplate.getBody()); - preparedStatement.setString(FOOTER, notificationTemplate.getFooter()); + preparedStatement.setNString(3, notificationTemplate.getSubject()); + preparedStatement.setNString(4, notificationTemplate.getBody()); + preparedStatement.setNString(5, notificationTemplate.getFooter()); preparedStatement.setString(CONTENT_TYPE, notificationTemplate.getContentType()); preparedStatement.setString(TYPE_KEY, displayName.toLowerCase()); preparedStatement.setString(CHANNEL, channelName); @@ -91,9 +91,9 @@ public NotificationTemplate getNotificationTemplate(String locale, String templa notificationTemplate = namedJdbcTemplate.fetchSingleRecord(GET_ORG_NOTIFICATION_TEMPLATE_SQL, (resultSet, rowNumber) -> { NotificationTemplate notificationTemplateResult = new NotificationTemplate(); - notificationTemplateResult.setSubject(resultSet.getString(SUBJECT)); - notificationTemplateResult.setBody(resultSet.getString(BODY)); - notificationTemplateResult.setFooter(resultSet.getString(FOOTER)); + notificationTemplateResult.setSubject(resultSet.getNString(SUBJECT)); + notificationTemplateResult.setBody(resultSet.getNString(BODY)); + notificationTemplateResult.setFooter(resultSet.getNString(FOOTER)); notificationTemplateResult.setContentType(resultSet.getString(CONTENT_TYPE)); notificationTemplateResult.setLocale(locale); notificationTemplateResult.setType(templateType); @@ -169,9 +169,9 @@ public List listNotificationTemplates(String templateType, notificationTemplates = namedJdbcTemplate.executeQuery(LIST_ORG_NOTIFICATION_TEMPLATES_BY_TYPE_SQL, (resultSet, rowNumber) -> { NotificationTemplate notificationTemplateResult = new NotificationTemplate(); - notificationTemplateResult.setSubject(resultSet.getString(SUBJECT)); - notificationTemplateResult.setBody(resultSet.getString(BODY)); - notificationTemplateResult.setFooter(resultSet.getString(FOOTER)); + notificationTemplateResult.setSubject(resultSet.getNString(SUBJECT)); + notificationTemplateResult.setBody(resultSet.getNString(BODY)); + notificationTemplateResult.setFooter(resultSet.getNString(FOOTER)); notificationTemplateResult.setContentType(resultSet.getString(CONTENT_TYPE)); notificationTemplateResult.setLocale(resultSet.getString(LOCALE)); notificationTemplateResult.setType(templateType.toLowerCase()); @@ -205,9 +205,9 @@ public void updateNotificationTemplate(NotificationTemplate notificationTemplate try { namedJdbcTemplate.executeUpdate(UPDATE_ORG_NOTIFICATION_TEMPLATE_SQL, preparedStatement -> { - preparedStatement.setString(SUBJECT, notificationTemplate.getSubject()); - preparedStatement.setString(BODY, notificationTemplate.getBody()); - preparedStatement.setString(FOOTER, notificationTemplate.getFooter()); + preparedStatement.setNString(1, notificationTemplate.getSubject()); + preparedStatement.setNString(2, notificationTemplate.getBody()); + preparedStatement.setNString(3, notificationTemplate.getFooter()); preparedStatement.setString(CONTENT_TYPE, notificationTemplate.getContentType()); preparedStatement.setString(TEMPLATE_KEY, locale.toLowerCase()); preparedStatement.setString(TYPE_KEY, displayName.toLowerCase());