title: What are differences between delete(Iterable<? extends T> itrbl) in CrudRepository and deleteInBatch(Iterable<T> itrbl) in JpaRepository
body: <p>I'm getting an issues when trying to delete a list of entities which have a foreign key. A delete method in <code>CrudRepository</code> work fine with table doesn't have foreign key but when I tried to delete a list of entities have foreign key, it reported success but nothing was delete in database. The <code>deleteInBatch()</code> work fine in both.</p>
  
  <p>What is differences between the method <code>delete(Iterable&lt;? extends T&gt; itrbl)</code> in <code>CrudRepository and deleteInBatch(Iterable&lt;T&gt; itrbl)</code> in <code>JpaRepository</code>?</p>
  
  <p>I have gone through <a href="https://stackoverflow.com/questions/14014086/what-is-difference-between-crudrepository-and-jparepository-interfaces-in-spring">this</a>.</p>
  
  <p>Any help would be appreciated  </p>
  
  <p>My model SmsNotifyTemplate.java: </p>
  
  <pre><code>package com.viettel.pcrf.webconfig.model;
  
  import java.io.Serializable;
  import javax.persistence.Basic;
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  import javax.persistence.Id;
  import javax.persistence.JoinColumn;
  import javax.persistence.ManyToOne;
  import javax.persistence.NamedQueries;
  import javax.persistence.NamedQuery;
  import javax.persistence.SequenceGenerator;
  import javax.persistence.Table;
  import javax.xml.bind.annotation.XmlRootElement;
  
  /**
   *
   * @author Anh Nguyen
   */
  @Entity
  @Table(name = "SMS_NOTIFY_TEMPLATE", catalog = "", schema = "VPCRF")
  @XmlRootElement
  @NamedQueries({
      @NamedQuery(name = "SmsNotifyTemplate.findAll", query = "SELECT s FROM SmsNotifyTemplate s"),
      @NamedQuery(name = "SmsNotifyTemplate.findBySmsNotifyTemplateId", query = "SELECT s FROM SmsNotifyTemplate s WHERE s.smsNotifyTemplateId = :smsNotifyTemplateId"),
      @NamedQuery(name = "SmsNotifyTemplate.findByMessageTemplate", query = "SELECT s FROM SmsNotifyTemplate s WHERE s.messageTemplate = :messageTemplate"),
      @NamedQuery(name = "SmsNotifyTemplate.findByComments", query = "SELECT s FROM SmsNotifyTemplate s WHERE s.comments = :comments"),
      @NamedQuery(name = "SmsNotifyTemplate.findBySmsTemplateCode", query = "SELECT s FROM SmsNotifyTemplate s WHERE s.smsTemplateCode = :smsTemplateCode")})
  public class SmsNotifyTemplate implements Serializable {
  
      public static enum COLUMNS {
  
          COMMENTS, LANGID, MESSAGETEMPLATE, SMSNOTIFYTEMPLATEID, SMSTEMPLATECODE
      };
      private static final long serialVersionUID = 1L;
      @Id
      @Basic(optional = false)
      @Column(name = "SMS_NOTIFY_TEMPLATE_ID", nullable = false)
      @GeneratedValue(strategy = GenerationType.AUTO, generator = "sms_notify_template_seq_gen")
      @SequenceGenerator(name = "sms_notify_template_seq_gen", sequenceName = "SMS_NOTIFY_TEMPLATE_SEQ")
      private Short smsNotifyTemplateId;
      @Column(name = "MESSAGE_TEMPLATE", length = 480)
      private String messageTemplate;
      @Column(name = "COMMENTS", length = 200)
      private String comments;
      @Column(name = "SMS_TEMPLATE_CODE")
      private Integer smsTemplateCode;
      @JoinColumn(name = "LANG_ID", referencedColumnName = "LANG_ID", nullable = false)
      @ManyToOne(optional = false)
      private Lang langId;
  
      public SmsNotifyTemplate() {
  
      }
  
      public SmsNotifyTemplate(Short smsNotifyTemplateId) {
          this.smsNotifyTemplateId = smsNotifyTemplateId;
      }
  
      public Short getSmsNotifyTemplateId() {
          return smsNotifyTemplateId;
      }
  
      public void setSmsNotifyTemplateId(Short smsNotifyTemplateId) {
          this.smsNotifyTemplateId = smsNotifyTemplateId;
      }
  
      public String getMessageTemplate() {
          return messageTemplate;
      }
  
      public void setMessageTemplate(String messageTemplate) {
          this.messageTemplate = messageTemplate;
      }
  
      public String getComments() {
          return comments;
      }
  
      public void setComments(String comments) {
          this.comments = comments;
      }
  
      public Integer getSmsTemplateCode() {
          return smsTemplateCode;
      }
  
      public void setSmsTemplateCode(Integer smsTemplateCode) {
          this.smsTemplateCode = smsTemplateCode;
      }
  
      public Lang getLangId() {
          return langId;
      }
  
      public void setLangId(Lang langId) {
          this.langId = langId;
      }
  
      @Override
      public int hashCode() {
          int hash = 0;
          hash += (smsNotifyTemplateId != null ? smsNotifyTemplateId.hashCode() : 0);
          return hash;
      }
  
      @Override
      public boolean equals(Object object) {
          // TODO: Warning - this method won't work in the case the id fields are not set
          if (!(object instanceof SmsNotifyTemplate)) {
              return false;
          }
          SmsNotifyTemplate other = (SmsNotifyTemplate) object;
          return !((this.smsNotifyTemplateId == null &amp;&amp; other.smsNotifyTemplateId != null) || (this.smsNotifyTemplateId != null &amp;&amp; !this.smsNotifyTemplateId.equals(other.smsNotifyTemplateId)));
      }
  
      @Override
      public String toString() {
          return "com.viettel.pcrf.model.SmsNotifyTemplate[ smsNotifyTemplateId=" + smsNotifyTemplateId + " ]";
      }
  
  }
  </code></pre>
  
  <p>I have a mapper to map the model with a normal class:</p>
  
  <p>SmsTemplateMapper.java:</p>
  
  <pre><code>package com.viettel.pcrf.webconfig.mapper;
  
  import com.viettel.fw.common.util.mapper.BaseMapper;
  import com.viettel.pcrf.webconfig.dto.SmsTemplateDTO;
  import com.viettel.pcrf.webconfig.model.SmsNotifyTemplate;
  
  public class SmsTemplateMapper extends BaseMapper&lt;SmsNotifyTemplate, SmsTemplateDTO&gt; {
  
      @Override
      public SmsTemplateDTO toDtoBean(SmsNotifyTemplate model) {
          SmsTemplateDTO obj = null;
          if (model != null) {
              obj = new SmsTemplateDTO();
              obj.setComments(model.getComments());
              obj.setMessageTemplate(model.getMessageTemplate());
              obj.setSmsNotifyTemplateId(model.getSmsNotifyTemplateId());
              obj.setSmsTemplateCode(model.getSmsTemplateCode());
              obj.setLangId(model.getLangId());
          }
          return obj;
      }
  
      @Override
      public SmsNotifyTemplate toPersistenceBean(SmsTemplateDTO dtoBean) {
          SmsNotifyTemplate obj = null;
          if (dtoBean != null) {
              obj = new SmsNotifyTemplate();
              obj.setComments(dtoBean.getComments());
              obj.setMessageTemplate(dtoBean.getMessageTemplate());
              obj.setSmsNotifyTemplateId(dtoBean.getSmsNotifyTemplateId());
              obj.setSmsTemplateCode(dtoBean.getSmsTemplateCode());
              obj.setLangId(dtoBean.getLangId());
              System.out.println(obj.getLangId().getNationality());
          }
          return obj;
      }
  }
  </code></pre>
  
  <p>SmsTemplateDTO.java:</p>
  
  <pre><code>package com.viettel.pcrf.webconfig.dto;
  
  import com.viettel.fw.dto.BaseDTO;
  import com.viettel.pcrf.webconfig.model.Lang;
  import java.io.Serializable;
  
  public class SmsTemplateDTO extends BaseDTO implements Serializable {
  
      public String getKeySet() {
          return keySet;
      }
      private String comments;
      private String messageTemplate;
      private Short smsNotifyTemplateId;
      private Integer smsTemplateCode;
      private Lang langId;
  
      public String getComments() {
          return this.comments;
      }
  
      public void setComments(String comments) {
          this.comments = comments;
      }
  
      public String getMessageTemplate() {
          return this.messageTemplate;
      }
  
      public void setMessageTemplate(String messageTemplate) {
          this.messageTemplate = messageTemplate;
      }
  
      public Short getSmsNotifyTemplateId() {
          return this.smsNotifyTemplateId;
      }
  
      public void setSmsNotifyTemplateId(Short smsNotifyTemplateId) {
          this.smsNotifyTemplateId = smsNotifyTemplateId;
      }
  
      public Integer getSmsTemplateCode() {
          return this.smsTemplateCode;
      }
  
      public void setSmsTemplateCode(Integer smsTemplateCode) {
          this.smsTemplateCode = smsTemplateCode;
      }
  
      public Lang getLangId() {
          return langId;
      }
  
      public void setLangId(Lang langId) {
          this.langId = langId;
      }
  
  }
  </code></pre>
  
  <p>SmsTemplateRepo.java:</p>
  
  <pre><code>package com.viettel.pcrf.webconfig.repo;
  import com.viettel.fw.persistence.BaseRepository;
  import java.util.List;
  import com.viettel.pcrf.webconfig.model.SmsNotifyTemplate;
  
  public interface SmsTemplateRepo extends BaseRepository&lt;SmsNotifyTemplate&gt;, SmsTemplateRepoCustom {
  
  
      public List&lt;SmsNotifyTemplate&gt; findByComments(String comments);
  
      public List&lt;SmsNotifyTemplate&gt; findByMessageTemplate(String messageTemplate);
  
      public List&lt;SmsNotifyTemplate&gt; findBySmsNotifyTemplateId(Short smsNotifyTemplateId);
  
      public List&lt;SmsNotifyTemplate&gt; findBySmsTemplateCode(Integer smsTemplateCode);
  }
  </code></pre>
  
  <p>BaseRepository extends JpaRepository.</p>
  
  <p>A delete method will be in deleteSmsNotifyTemplates method in this class:</p>
  
  <p>SmsTemplateServiceImpl.java:</p>
  
  <pre><code>package com.viettel.pcrf.webconfig.service;
  
  import com.viettel.fw.common.util.extjs.FilterRequest;
  import com.viettel.fw.dto.BaseMessage;
  import com.viettel.pcrf.webconfig.repo.SmsTemplateRepo;
  import com.viettel.pcrf.webconfig.mapper.SmsTemplateMapper;
  import com.viettel.pcrf.webconfig.dto.SmsTemplateDTO;
  import com.viettel.pcrf.webconfig.model.SmsNotifyTemplate;
  import java.util.List;
  import org.apache.log4j.Logger;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Service;
  
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.Comparator;
  
  /**
   *
   * @author Anh Nguyen
   */
  @Service
  public class SmsTemplateServiceImpl extends BaseServiceImpl implements SmsTemplateService {
  
      private final SmsTemplateMapper mapper = new SmsTemplateMapper();
  
      @Autowired
      private SmsTemplateRepo repository;
      public Logger logger = Logger.getLogger(SmsTemplateService.class);
  
      @Override
      public BaseMessage deleteSmsNotifyTemplates(List&lt;SmsTemplateDTO&gt; smsNotifyTemplateDTOs) throws Exception {
          BaseMessage baseMessage = new BaseMessage();
          repository.delete(mapper.toPersistenceBean(smsNotifyTemplateDTOs));
          baseMessage.setSuccess(true);
          baseMessage.setOutputObject(smsNotifyTemplateDTOs);
          return baseMessage;
      }         
  }
  </code></pre>
  
  <p>The Controller:</p>
  
  <p>SmsTemplateCtrl.java:</p>
  
  <pre><code>package com.viettel.pcrf.webconfig.controller;
  
  import com.viettel.fw.Exception.LogicException;
  import com.viettel.fw.common.util.extjs.FilterRequest;
  import com.viettel.fw.web.controller.BaseController;
  import com.viettel.pcrf.webconfig.dto.LangDTO;
  import com.viettel.pcrf.webconfig.dto.SmsTemplateDTO;
  import com.viettel.pcrf.webconfig.model.Lang;
  import com.viettel.pcrf.webconfig.service.LangService;
  import com.viettel.pcrf.webconfig.service.SmsTemplateService;
  import java.io.Serializable;
  import java.util.ArrayList;
  import java.util.List;
  import javax.annotation.PostConstruct;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.context.annotation.Scope;
  import org.springframework.stereotype.Component;
  
  /**
   *
   * @author Anh Nguyen
   */
  @Component("smsNotifyTemplateController")
  @Scope("view")
  public class SmsTemplateCtrl extends BaseController implements Serializable {
  
      private List&lt;SmsTemplateDTO&gt; listSmsNotifyTemplate;
      private SmsTemplateDTO smsNotifyTemplate;
      private List&lt;SmsTemplateDTO&gt; selectedSmsNotifyTemplates;
      private List&lt;LangDTO&gt; listLang;
  
      @Autowired
      private SmsTemplateService smsNotifyTemplateService;
  
      @Autowired
      private LangService langService;
  
      public List&lt;SmsTemplateDTO&gt; getListSmsNotifyTemplate() {
          return listSmsNotifyTemplate;
      }
  
      public void setListSmsNotifyTemplate(List&lt;SmsTemplateDTO&gt; listSmsNotifyTemplate) {
          this.listSmsNotifyTemplate = listSmsNotifyTemplate;
      }
  
      public SmsTemplateDTO getSmsNotifyTemplate() {
          return smsNotifyTemplate;
      }
  
      public void setSmsNotifyTemplate(SmsTemplateDTO smsNotifyTemplate) {
          this.smsNotifyTemplate = smsNotifyTemplate;
      }
  
      public List&lt;SmsTemplateDTO&gt; getSelectedSmsNotifyTemplates() {
          return selectedSmsNotifyTemplates;
      }
  
      public void setSelectedSmsNotifyTemplates(List&lt;SmsTemplateDTO&gt; selectedSmsNotifyTemplates) {
          this.selectedSmsNotifyTemplates = selectedSmsNotifyTemplates;
      }
  
      public List&lt;LangDTO&gt; getListLang() {
          return listLang;
      }
  
      public void setListLang(List&lt;LangDTO&gt; listLang) {
          this.listLang = listLang;
      }
  
      /**
       * Khoi Tao Cac doi tuong de load len view
       */
      @PostConstruct
      public void init() {
          listSmsNotifyTemplate = smsNotifyTemplateService.findAllSort();
          listLang = langService.findAllSort();
          formStatus = getFormStatus();
      }
  
      /**
       * Chuan bi cho thao tac delete
       */
      public void delete() {
          try {
              if (selectedSmsNotifyTemplates == null || selectedSmsNotifyTemplates.isEmpty()) {
                  reportError("msgInfo", "Choose one row!");
              } else {
                  smsNotifyTemplateService.deleteSmsNotifyTemplates(selectedSmsNotifyTemplates);
                  reportSuccess("msgInfo", "common.msg.success.delete");
                  reset();
                  updateController();
              }
          } catch (LogicException logicE) {
              reportError("msgInfo", logicE);
          } catch (Exception exception) {
              reportError("msgInfo", exception.getMessage());
          }
      }
  
      /**
       * Kiem tra SmsNotifyTemplateId ton tai trong bang SMS_NOTIFY_TEMPLATE
       *
       * @param smsNotifyTemplates
       * @return
       */
      public boolean SmsNotifyTemplateIdExistedInSmsNotifyTemplate(List&lt;SmsTemplateDTO&gt; smsNotifyTemplates) {
          List&lt;FilterRequest&gt; listReq = new ArrayList&lt;&gt;();
          for (SmsTemplateDTO s : smsNotifyTemplates) {
              listReq.add(new FilterRequest("LANGID", s.getLangId()));
          }
          List&lt;SmsTemplateDTO&gt; list = smsNotifyTemplateService.findAll(listReq);
          return !list.isEmpty();
      }
  
      /**
       * Kiem tra SmsNotifyTemplateCode ton tai trong bang LANG
       *
       * @param smsTemplateCode
       * @param smsNotifyTemplateId
       * @return
       */
      public boolean SmsTemplateCodeExisted(Integer smsTemplateCode, Short smsNotifyTemplateId) {
          List&lt;FilterRequest&gt; listReq = new ArrayList&lt;&gt;();
          listReq.add(new FilterRequest("SMSTEMPLATECODE", smsTemplateCode));
          List&lt;SmsTemplateDTO&gt; list = smsNotifyTemplateService.findAll(listReq);
          if (list.isEmpty()) {
              return false;
          }
          if (list.size() &gt; 1) {
              return true;
          } else {
              return !list.get(0).getSmsNotifyTemplateId().equals(smsNotifyTemplateId);
          }
      }
  
  }
  </code></pre>
  
  <p>And the xhtml page. I'm using primefaces framework.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:p="http://primefaces.org/ui"
        xmlns:ui="http://java.sun.com/jsf/facelets"&gt;
      &lt;ui:composition template="../../templates/layoutTemplate.xhtml" &gt;
          &lt;ui:define name="title"&gt;SMS Notify Template Configuration&lt;/ui:define&gt;
          &lt;ui:define name="featureName"&gt;SMS Notify Template Configuration&lt;/ui:define&gt;
          &lt;ui:define name="content"&gt;
              &lt;h:form id="frmSmsNotifyTemplate"&gt;
                  &lt;p:dataTable var="tabSmsNotifyTemplate"
                               id="smsNotifyTemplateList"
                               value="#{smsNotifyTemplateController.listSmsNotifyTemplate}"
                               selection="#{smsNotifyTemplateController.selectedSmsNotifyTemplates}"
                               rowsPerPageTemplate="5,10,15,20,50"
                               paginatorPosition="bottom"
                               paginator="true"
                               rows="10"
                               paginatorAlwaysVisible="false"
                               sortMode="single"
                               sortBy="#{tabSmsNotifyTemplate.smsNotifyTemplateId}"
                               rowKey="#{tabSmsNotifyTemplate.smsNotifyTemplateId}" &gt;
                      &lt;p:column selectionMode="multiple" style="width:16px;text-align:center" /&gt;
                      &lt;p:ajax event="toggleSelect" update="@([id$=btnEdit]) @([id$=btnDelete])" /&gt;
                      &lt;p:ajax event="rowSelect" update="@([id$=btnEdit]) @([id$=btnDelete])" /&gt;
                      &lt;p:ajax event="rowSelectCheckbox" update="@([id$=btnEdit]) @([id$=btnDelete])" /&gt;
                      &lt;p:ajax event="rowUnselectCheckbox" update="@([id$=btnEdit]) @([id$=btnDelete])" /&gt;
                      &lt;p:column headerText="ID" style="width: 100px;"&gt;
                          &lt;h:outputText value="#{tabSmsNotifyTemplate.smsNotifyTemplateId}" /&gt;
                      &lt;/p:column&gt;
                      &lt;p:column headerText="Message Template" style="width: 100px;" sortBy="#{tabSmsNotifyTemplate.messageTemplate}"&gt;
                          &lt;h:outputText value="#{tabSmsNotifyTemplate.messageTemplate}" /&gt;
                      &lt;/p:column&gt;
                      &lt;p:column headerText="SMS Template Code" sortBy="#{tabSmsNotifyTemplate.smsTemplateCode}"&gt;
                          &lt;h:outputText value="#{tabSmsNotifyTemplate.smsTemplateCode}" /&gt;
                      &lt;/p:column&gt;
                      &lt;p:column headerText="Language" sortBy="#{tabSmsNotifyTemplate.langId.nationality}"&gt;
                          &lt;h:outputText value="#{tabSmsNotifyTemplate.langId.nationality}" /&gt;
                      &lt;/p:column&gt;
                      &lt;p:column headerText="Comments" sortBy="#{tabSmsNotifyTemplate.comments}"&gt;
                          &lt;h:outputText value="#{tabSmsNotifyTemplate.comments}" /&gt;
                      &lt;/p:column&gt;
                      &lt;f:facet name="footer"&gt;
                          &lt;div align="left"&gt;
                              &lt;span class="vt-button"&gt;
                                  &lt;p:commandLink
                                      action="#{smsNotifyTemplateController.prepareInsert()}"
                                      process="smsNotifyTemplateList"
                                      update="@form"
                                      resetValues="true"
                                      style="margin-right:30px;border: none"&gt;
                                      &lt;p:graphicImage style="width:10px;height:10px;"
                                                      value="/resources/themes/images/icon-add.png"/&gt;
                                      &lt;span class="vt-button-text"&gt;
                                          &lt;h:outputText value="#{lang['common.button.add']}"/&gt;
                                      &lt;/span&gt;
                                      &lt;f:setPropertyActionListener
                                          target="#{smsNotifyTemplateController.formStatus}"
                                          value="#{vpcrfConst.BTN_ADD}"/&gt;
                                  &lt;/p:commandLink&gt;
                                  &lt;p:commandLink
                                      id="btnEdit"
                                      action="#{smsNotifyTemplateController.prepareEdit()}"
                                      process="smsNotifyTemplateList"
                                      update="@form"
                                      disabled="#{smsNotifyTemplateController.selectedSmsNotifyTemplates.size()&amp;gt;1 or smsNotifyTemplateController.selectedSmsNotifyTemplates==null or smsNotifyTemplateController.selectedSmsNotifyTemplates.size()==0}"
                                      resetValues="true"
                                      style="margin-right:30px;border: none"&gt;
                                      &lt;p:graphicImage style="width:10px;height:10px;"
                                                      value="/resources/themes/images/icon-edit.png"/&gt;
                                      &lt;span class="vt-button-text"&gt;
                                          &lt;h:outputText value="#{lang['common.button.edit']}"/&gt;
                                      &lt;/span&gt;
                                      &lt;f:setPropertyActionListener
                                          target="#{smsNotifyTemplateController.formStatus}"
                                          value="#{vpcrfConst.BTN_EDIT}"/&gt;
                                  &lt;/p:commandLink&gt;
                                  &lt;p:commandLink
                                      id="btnDelete"
                                      action="#{smsNotifyTemplateController.delete()}"
                                      immediate="true"
                                      update="@form"
                                      disabled="#{smsNotifyTemplateController.selectedSmsNotifyTemplates.size()==0 or smsNotifyTemplateController.selectedSmsNotifyTemplates==null}"
                                      resetValues="true"
                                      style="margin-right:30px;border: none"&gt;
                                      &lt;p:graphicImage style="width:10px;height:10px;"
                                                      value="/resources/themes/images/icon-delete.png"/&gt;
                                      &lt;span class="vt-button-text"&gt;
                                          &lt;h:outputText value="#{lang['common.button.delete']}"/&gt;
                                      &lt;/span&gt;
                                      &lt;p:confirm header="Delete" message="Are you sure? (Ok/Cancel)" icon="ui-icon-alert" /&gt;
                                  &lt;/p:commandLink&gt;
                              &lt;/span&gt;
                          &lt;/div&gt;
                      &lt;/f:facet&gt;
                  &lt;/p:dataTable&gt;
                  &lt;p:growl id="testMsg" showSummary="false" showDetail="true" autoUpdate="true" sticky="true" /&gt;
                  &lt;p:focus context="editPanel"/&gt;
                  &lt;p:fieldset legend="SMS Notify Template Detail" rendered="#{smsNotifyTemplateController.smsNotifyTemplate!=null}"&gt;
                      &lt;h:panelGrid id="editPanel"
                                   columnClasses="vocs-120, vocs-300"
                                   columns="2" rendered="#{smsNotifyTemplateController.smsNotifyTemplate!=null}"&gt;
                          &lt;p:outputLabel for="smsID" value="ID" /&gt;
                          &lt;p:inputText id="smsID"
                                       value="#{smsNotifyTemplateController.smsNotifyTemplate.smsNotifyTemplateId}"
                                       required="true"
                                       maxlength="15"
                                       disabled="true"
                                       style="min-width: 300px;"/&gt;
                          &lt;p:outputLabel for="messTemplate" value="Message Template" /&gt;
                          &lt;p:inputText id="messTemplate"
                                       value="#{smsNotifyTemplateController.smsNotifyTemplate.messageTemplate}"
                                       required="true"
                                       maxlength="60"
                                       style="min-width: 300px;"/&gt;
                          &lt;p:outputLabel for="langId" value="SMS Notify Template" /&gt;
                          &lt;p:selectOneMenu id="langId" 
                                           required="true"
                                           value="#{smsNotifyTemplateController.smsNotifyTemplate.langId.langId}"
                                           style="width: 306px;"&gt;
                              &lt;f:selectItem itemLabel="Select Language"
                                            itemDisabled="true" 
                                            noSelectionOption="true"/&gt;
                              &lt;f:selectItems value="#{smsNotifyTemplateController.listLang}"
                                             var="l"
                                             itemLabelEscaped="true"
                                             itemValue="#{l.langId}" 
                                             itemLabel="#{l.nationality}" /&gt;
                          &lt;/p:selectOneMenu&gt;
                          &lt;p:outputLabel for="templateCode" value="Template Code" /&gt;
                          &lt;p:inputTextarea id="templateCode"
                                           value="#{smsNotifyTemplateController.smsNotifyTemplate.smsTemplateCode}"
                                           required="true"
                                           maxlength="10"
                                           style="min-width: 300px;"/&gt;
                          &lt;p:outputLabel for="comments" value="Comments" /&gt;
                          &lt;p:inputTextarea id="comments"
                                           value="#{smsNotifyTemplateController.smsNotifyTemplate.comments}"
                                           required="false"
                                           maxlength="10"
                                           style="min-width: 300px;"/&gt;
                          &lt;div /&gt;
                          &lt;h:panelGroup&gt;
                              &lt;p:commandButton
                                  value="OK"
                                  process="editPanel"
                                  rendered="#{smsNotifyTemplateController.formStatus==vpcrfConst.BTN_ADD}"
                                  action="#{smsNotifyTemplateController.insert()}"
                                  update="smsNotifyTemplateList,editPanel,@form" /&gt;
                              &lt;p:commandButton rendered="#{smsNotifyTemplateController.formStatus==vpcrfConst.BTN_ADD}"
                                               value="#{lang['common.button.reset']}"
                                               immediate="true"&gt;
                                  &lt;p:ajax update="smsID,messTemplate,langId,templateCode,comments" resetValues="true" /&gt;
                              &lt;/p:commandButton&gt;
                              &lt;p:commandButton
                                  value="OK"
                                  rendered="#{smsNotifyTemplateController.formStatus==vpcrfConst.BTN_EDIT}"
                                  action="#{smsNotifyTemplateController.update()}"
                                  update="smsNotifyTemplateList,editPanel,@form" /&gt;
                              &lt;p:commandButton rendered="#{smsNotifyTemplateController.formStatus==vpcrfConst.BTN_EDIT}"
                                               value="#{lang['common.button.reset']}"
                                               immediate="true"
                                               action="#{smsNotifyTemplateController.clearInput()}"
                                               update="smsID,messTemplate,langId,templateCode,comments"
                                               resetValues="true"/&gt;     
                              &lt;p:commandButton
                                  value="#{lang['common.button.cancel']}"
                                  action="#{smsNotifyTemplateController.reset()}"
                                  immediate="true"
                                  update="@form"/&gt;
                          &lt;/h:panelGroup&gt;
                      &lt;/h:panelGrid&gt;
                  &lt;/p:fieldset&gt;
              &lt;/h:form&gt;
          &lt;/ui:define&gt;
      &lt;/ui:composition&gt;
  &lt;/html&gt;
  </code></pre>