I’m trying to join one table, with two other tables, using a single column in Java using Hibernate and JPQL.
For example, I have table A with an id column. I want to join table B and table C with table A on the id column.
However, when I try to do that I get the following error:
org.hibernate.exception.DataException: The value supplied cannot be converted to BIGINT. I have seen some answer say that there may be null values, but these id columns are primary id columns, and contain no nulls.
My code is as follows:
@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
When I remove one of the two joins everything works fine again.
What am I doing wrong that’s causing this issue?
I don’t know what type
idis, but is but I think it must be aLongin order for Hibernate to convert it to aBIGINT