• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Composite primary key-Exception:could not resolve property

 
hr rick
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My problem is that I split my manytomany relations into two onetomany relations, but when I query datas using Criteria, the code throws Exceptions that could not resolve property. Here is my code:

My PK class is :









and then, I wrote an criteria query test:


but when I query data like this, it works:



when I use the junit to test the testAccidentRole() method, I encountered the following exception:


This problem really made me crazy and I tried to solve that for a long time. Could someone help me out? Thanks a lot.

 
Rishi Shehrawat
Ranch Hand
Posts: 218
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mapping of roleid property to database column is missing in AccidentRole entity.
 
hr rick
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My roleid property is in my Role class.
 
Rishi Shehrawat
Ranch Hand
Posts: 218
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The roleid property is not mapped to table column in Role entity.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic