Forums
Hibernate: ORA-00932: inconsistent datatypes: expected NUMBER got BINARY - Printable Version

+- Forums (https://digdascloud.nl/myBB)
+-- Forum: Digdas forum (https://digdascloud.nl/myBB/forumdisplay.php?fid=1)
+--- Forum: Java stuff (https://digdascloud.nl/myBB/forumdisplay.php?fid=2)
+--- Thread: Hibernate: ORA-00932: inconsistent datatypes: expected NUMBER got BINARY (/showthread.php?tid=9)



Hibernate: ORA-00932: inconsistent datatypes: expected NUMBER got BINARY - digdas - 08-11-2014

The query it occurs on:
Code:
from User user where user.hometown=#{searchObject.town};

Mapping:
Code:
public class User {
...
@Column(name="HOMETOWN_ID", columnDefinition="NUMBER")
public Town getHomeTown() {
return homeTown;
}
...
}

The problem is the mapping. The class Town should be mapped with a ManyToOne mapping. So it should be:
Code:
public class User {
...
@ManyToOne
@JoinColumn(name="HOMETOWN_ID", columnDefinition="NUMBER")
public Town getHomeTown() {
return homeTown;
}
...
}