title: Java Hibernate DataException: cannot be converted to BIGINT
body: <p>I'm trying to join one table, with two other tables, using a single column in Java using Hibernate and JPQL.</p>
  
  <p>For example, I have <code>table A</code> with an <code>id</code> column. I want to join <code>table B</code> and <code>table C</code> with <code>table A</code> on the <code>id</code> column. </p>
  
  <p>However, when I try to do that I get the following error:
  <code>org.hibernate.exception.DataException: The value supplied cannot be converted to BIGINT</code>. I have seen some answer say that there may be null values, but these id columns are primary id columns, and contain no nulls.</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>@OneToOne(fetch = fetchType.LAZY)
  @JoinColumn(name="id", insertable=false, updatable=false)
  private TableB tableB
  
  @OneToOne(fetch = fetchType.LAZY)
  @JoinColumn(name="id", insertable=false, updatable=false)
  private TableC tableC
  </code></pre>
  
  <p>When I remove one of the two joins everything works fine again.</p>
  
  <p>What am I doing wrong that's causing this issue?</p>