Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EntityNotFoundException in junit with jpa-hibernate  RSS feed

 
manish ghildiyal
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am facing an issue while running a junit.
I have an entity A which contains another entity B.
In my business logic component I get A's instance from data base using spring data API. I call its getB() method which gets me B's reference.
But when I call a method on B's reference I get EntityNotFoundException with message also stating the id for which B was not found.
I am not able to understand why does getB() returns B and then I get EntityNotFoundException.
Secondly, in DB I can see B for the id, then why do I get EntityNotFoundException?

Manish
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!