java hibernate Unknown column ' ' in 'field list'
Please make sure the table you are calling have the right columns. I had the issue and I found that the mapped domain columns were not matching in the database.
I noticed that, while I used a variable name like userName or bloodGroup, it's getting the error "Caused by: java.sql.SQLSyntaxErrorException: Unknown column 'user0_.blood_group' in 'field list' " To overcome this issue change the variable name like username or blood_Group. I hope it will get the excepted result.
Check out this code:
@JoinTable(name="Houses", joinColumns = @JoinColumn(name="id"), inverseJoinColumns=@JoinColumn(name="houses_id"))
I'm not sure what are you trying to achieve here, but JoinTable is usually used to resolve ManyToMany relations with intermediary table. So this code implies that you have table Houses
with id
and houses_id
columns. Error message says that there is no houses_id
in Houses
table (which sounds logical to me)
Maybe you should try ManyToOne and JoinColumn instead? For example:
@JoinColumn(name="house_id")
or houses_id
if that's your foreign key in streets table. Plural sounds strange if this is really many-to-one relationship.