title: Hibernate Exception : java.sql.SQLException: Invalid value for getInt() - 'T2'
body: <p>In my Spring-Hibernate Application, i have 4 bean classes like UserVO,BookVO,AttandanceVO and Timetable.</p>
  
  <p>and my AttendanceVO bean class:</p>
  
  <pre><code>@ManyToOne
  @JoinColumn(name="BOOK_ID")
  private BookVO book;
   //Setters and getters.
  </code></pre>
  
  <p>and my BookVO bean class:</p>
  
  <pre><code>@ManyToOne
  @JoinColumn(name = "USER_ID")
  private UserVO user;
  @ManyToOne
  @JoinColumn(name = "Time_ID")
  private TimeTable timetable;
  
  //Setters and getters
  </code></pre>
  
  <p>In my Hibernate class i'm writing query ..</p>
  
  <pre><code> @Transactional
  public List&lt;AttendanceVO&gt; findAttendanceList(UserVO user){
      TypedQuery&lt;AttendanceVO&gt; query = entityManager.createQuery("select av from AttendanceVO av inner join av.book bb  where bb.user=:user",
              AttendanceVO.class);
      query.setParameter("user", user);
      return query.getResultList();
   }
  </code></pre>
  
  <p>But i'm get Exception like..</p>
  
  <pre><code> SEVERE: Servlet.service() for servlet [spring] in context with path [/EClass] threw exception [Request processing failed; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not load an entity: [com.sits.ec.valueObjects.BookVO#A2]] with root cause
  java.sql.SQLException: Invalid value for getInt() - 'T2'
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
   ..............
  </code></pre>
  
  <p>Actually T2 is Timetable Id, why T2 coming hear i'm not include timetable in my query ..</p>
  
  <p>Is their any mapping needed?</p>
  
  <pre><code>Edit 1:
  
  
   @Entity
  @Table(name = "BOOK")
  public class BookVO{
  
      @ManyToOne
      @JoinColumn(name = "USER_ID")
      private UserVO user;
  
      @ManyToOne
      @JoinColumn(name = "TIMETABLE_ID")
      private TimetableVO timetable;
  //Setters and getters
  }
  </code></pre>