title: java.sql.SQLException: Invalid value for getInt() - 'foo'
body: <p>I have this error "Invalid value for getInt() - 'sirocodir'" , i have search in many forum but no response for my case. </p>
  
  <p>In my database the "Auteur_Id" type is a varchar(20).</p>
  
  <p>My Facture Entity:</p>
  
  <pre><code>@Entity
  @Table(name = "Factures")
  public class Factures implements java.io.Serializable {
  
  private Collaborateurs collaborateurs;
  
  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "Auteur_Id", nullable = false)
  public Collaborateurs getCollaborateurs() {
      return this.collaborateurs;
  }
  
  public void setCollaborateurs(Collaborateurs collaborateurs) {
      this.collaborateurs = collaborateurs;
  }
  </code></pre>
  
  <p>My Collaborateurs entity:</p>
  
  <pre><code>@OneToMany(fetch = FetchType.LAZY, mappedBy = "collaborateurs")
  public Set&lt;Factures&gt; getfactures() {
      return this.factures;
  }
  
  public void setfactures(Set&lt;Factures&gt; factures) {
      this.factures = factures;
  }
  </code></pre>
  
  <p>My service:</p>
  
  <pre><code>@Transactional(readOnly=true)
  public List&lt;Factures&gt; AllFacturesContratsClient() {
  
      return sessionFactory.getCurrentSession()
              .createQuery("from Factures").list();
  }
  </code></pre>
  
  <p>Log tomcat:</p>
  
  <pre><code>Caused by: java.sql.SQLException: Invalid value for getInt() - 'sirocodir'
  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
  at com.mysql.jdbc.ResultSetImpl.getInt(ResultSetImpl.java:2725)
  at com.mysql.jdbc.ResultSetImpl.getInt(ResultSetImpl.java:2813)
  at org.apache.commons.dbcp.DelegatingResultSet.getInt(DelegatingResultSet.java:237)
  at org.hibernate.type.IntegerType.get(IntegerType.java:51)
  at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:186)
  at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:175)
  at org.hibernate.type.ManyToOneType.hydrate(ManyToOneType.java:158)
  at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2267)
  at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1443)
  at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1371)
  at org.hibernate.loader.Loader.getRow(Loader.java:1271)
  at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:619)
  at org.hibernate.loader.Loader.doQuery(Loader.java:745)
  at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
  at org.hibernate.loader.Loader.doList(Loader.java:2449)
  ... 126 more
  </code></pre>