• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting "object is not an instance of declaring class" exception. Please help.  RSS feed

 
Harpreet Singh janda
Ranch Hand
Posts: 317
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am practicing with associations in Hibernate. While trying one-to-many and many-to-one association i am getting below error:



related java pojo's are

and


Hibernate mapping fileas are:


I am using below code to insert the subcategories :


Please help. I have tried to search the related topic, but could not help.
 
Harpreet Singh janda
Ranch Hand
Posts: 317
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it.
There was a problem in mapping.
 
shakthi balaji
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I'm also getting the same problem( The scenario is exactly same). Could you please tell me what did you changed in your mapping?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!