I'm trying to make a simple query joining 3 tables to get some information.
I have this query which is working:
Code:
String sql = "select ib.answerID, count(ib.score) from package.Answer ib group by ib.userID";
This is working just fine.. In the table with answers I also have a column called categoryID which is a FK to a table with categories. I have tried to join with this table to get the category name, but it's just not working. I tried the following query
Code:
String sql = "select cat.name, ib.answerID, count(ib.score) from package.Answer ib join ib.categoryID cat group by ib.userID";
This exceptions is thrown:
Code:
could not resolve property: name of: package.Answer
Why can't I just fetch the name from the category table and store them in the array the same way as in the first query?
How can I get this to work?