Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

BasicPathUsageException: Cannot join to attribute of basic type

 
RichardH Marais
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using Java 8 with JSP (Hibernate 5.2.1). I have a like clause which works perfectly, until I introduce the like clause to make use the foreign key table values too.

I am getting the following error:

BasicPathUsageException: Cannot join to attribute of basic type

I think the problem is related to the fact that I have a join table, and I am not sure how to create the LIKE Join using the join table.

Employee - employee_category - category

model (Employee.java):



model (Category.java):



JPA

When I introduce the following code, it fails with the error above (I think the problem is with this new piece of code):



This is the entire method:




Any help will e appreciated.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2534
113
Android Chrome Eclipse IDE
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you want to join on the "categories" rather than on the id-field.
 
RichardH Marais
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Frits, that worked. You saved me a lot of time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic