Forums

Full Version: Hibernate: ORA-00932: inconsistent datatypes: expected NUMBER got BINARY
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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;
}
...
}