title: javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.DataException: could not execute statement
body: <p>i'm getting this error:</p>
  
  <pre><code>Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect integer value: 'ANTIQUES Value 1' for column 'category' at row 1
  </code></pre>
  
  <p>after selecting a value from selectOneMenu and trying to save the entity into database; the selectOneMenu is populated with SelectItemGroup:</p>
  
  <pre><code>private List&lt;SelectItem&gt; options = new ArrayList&lt;SelectItem&gt;();
  
      public CategoryBean()
      {
          SelectItemGroup group1 = new SelectItemGroup("ANTIQUES");
          group1.setSelectItems(new SelectItem[] {
              new SelectItem("ANTIQUES Value 1", "European Antiques"),
              new SelectItem("ANTIQUES Value 1", "Asian Antiques"),
              new SelectItem("ANTIQUES Value 2", "Furniture"),
              new SelectItem("ANTIQUES Value 3", "Books and Manuscripts"),
              new SelectItem("ANTIQUES Value 3", "Architecture")
          });
          options.add(group1);
  
          SelectItemGroup group2 = new SelectItemGroup("ART");
          group2.setSelectItems(new SelectItem[] {
              new SelectItem("ART Value 1", "PAINTINGS"),
              new SelectItem("ART Value 4", "HANDMADE ART"),
              new SelectItem("ART Value 5", "PHOTOS")
          });
          options.add(group2);
  </code></pre>
  
  <p>..</p>
  
  <p>and the selected value is stored as a String in the entity table</p>
  
  <p>Any idea? 
  Thanks in advance!</p>