title: Error converting data type nvarchar to decimal error when updating hibernate object
body: <p>I have a JSF application using hibernate.<br>
  I load a set of points for a polygon and want to update the points.</p>
  
  <p>I update the point information, but when I attempt to commit the changes, I get the following error:</p>
  
  <pre><code>    WARNING: SQL Error: 8114, SQLState: S0005
      SEVERE: Error converting data type nvarchar to decimal.
      SEVERE: Could not synchronize database state with session
      org.hibernate.exception.SQLGrammarException: could not update: [hibernate.TbPolygonPoint#937]
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
  </code></pre>
  
  <p>I am confused, since I do not have any character information in the object I am attempting to update.</p>
  
  <p>Does anyone know why I get this error and how can I resolve it?
  Thanks.</p>
  
  <p>Here is the update code.  I get the error when attempting to do the commit:</p>
  
  <pre><code>    public int updatePolygonPoint( long polyPointId, int sGroup, int group, double lat, double lon )
      {
          int stat = 0;
          TbPolygonPoint point = null;
          try
         {
              BigDecimal bdLat = new BigDecimal(lat);
              BigDecimal bdLon = new BigDecimal(lon);
              org.hibernate.Transaction tx = session.beginTransaction();
              point = (TbPolygonPoint)session.get(TbPolygonPoint.class, polyPointId);
              point.setIsuperGroupId(sGroup);
              point.setIgroupId(group);
              point.setDcLatitude(bdLat);
              point.setDcLongitude(bdLon);
              try
              {
                  session.update(point);
                  tx.commit();
                  this.session = HibernateUtil.getSessionFactory().openSession();
                  stat = 1;
              }
              catch(Exception e)
              {
                  tx.rollback();
                  e.printStackTrace();
                  status = e.getMessage();
                  stat = -1;
              }
          }
          catch( Exception ex )
          {
               ex.printStackTrace();
              status = ex.getMessage();
              stat = -1;
          }
          return stat;
      }
  </code></pre>
  
  <p>Here is the java code for the object.        </p>
  
  <pre><code>    import java.math.BigDecimal;
      import java.util.HashSet;
      import java.util.Set;
  
      /**
      * TbPolygonPoint generated by hbm2java
      */
      public class TbPolygonPoint  implements java.io.Serializable {
  
  
          private long biPolygonPointId;
          private TbPolygonLoadFile tbPolygonLoadFile;
          private int isuperGroupId;
          private int igroupId;
          private BigDecimal dcLatitude;
          private BigDecimal dcLongitude;
          private Set&lt;TbPolygonHasPoints&gt; tbPolygonHasPointses = new HashSet&lt;TbPolygonHasPoints&gt;(0);
  
          public TbPolygonPoint() {
          }
  
  
          public TbPolygonPoint(long biPolygonPointId, int isuperGroupId, int igroupId, BigDecimal dcLatitude, BigDecimal dcLongitude) {
              this.biPolygonPointId = biPolygonPointId;
              this.isuperGroupId = isuperGroupId;
              this.igroupId = igroupId;
              this.dcLatitude = dcLatitude;
              this.dcLongitude = dcLongitude;
          }
          public TbPolygonPoint(long biPolygonPointId, TbPolygonLoadFile tbPolygonLoadFile, int isuperGroupId, int igroupId, BigDecimal dcLatitude, BigDecimal dcLongitude, Set&lt;TbPolygonHasPoints&gt; tbPolygonHasPointses) {
          this.biPolygonPointId = biPolygonPointId;
          this.tbPolygonLoadFile = tbPolygonLoadFile;
          this.isuperGroupId = isuperGroupId;
          this.igroupId = igroupId;
          this.dcLatitude = dcLatitude;
          this.dcLongitude = dcLongitude;
          this.tbPolygonHasPointses = tbPolygonHasPointses;
          }
  
          public long getBiPolygonPointId() {
              return this.biPolygonPointId;
          }
  
          public void setBiPolygonPointId(long biPolygonPointId) {
              this.biPolygonPointId = biPolygonPointId;
          }
          public TbPolygonLoadFile getTbPolygonLoadFile() {
              return this.tbPolygonLoadFile;
          }
  
          public void setTbPolygonLoadFile(TbPolygonLoadFile tbPolygonLoadFile) {
              this.tbPolygonLoadFile = tbPolygonLoadFile;
          }
          public int getIsuperGroupId() {
              return this.isuperGroupId;
          }
  
          public void setIsuperGroupId(int isuperGroupId) {
              this.isuperGroupId = isuperGroupId;
          }
          public int getIgroupId() {
              return this.igroupId;
          }
  
          public void setIgroupId(int igroupId) {
              this.igroupId = igroupId;
          }
          public BigDecimal getDcLatitude() {
              return this.dcLatitude;
          }
  
          public void setDcLatitude(BigDecimal dcLatitude) {
              this.dcLatitude = dcLatitude;
          }
          public BigDecimal getDcLongitude() {
              return this.dcLongitude;
          }
  
          public void setDcLongitude(BigDecimal dcLongitude) {
              this.dcLongitude = dcLongitude;
          }
          public Set&lt;TbPolygonHasPoints&gt; getTbPolygonHasPointses() {
              return this.tbPolygonHasPointses;
          }
  
          public void setTbPolygonHasPointses(Set&lt;TbPolygonHasPoints&gt; tbPolygonHasPointses) {
              this.tbPolygonHasPointses = tbPolygonHasPointses;
          }
      }
  </code></pre>