• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Merge detached sub-class entity (JPA InheritanceType.SINGLE_TABLE) org.hibernate.WrongClassException

 
H Paul
Ranch Hand
Posts: 471
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(Not sure what the issue is, could be Java related or flow design.
the title may be misleading (99% ?), but for the background, I put below 5 points. 1M Thanks.)


1. Simple Object Model: ProspectCustomer extends Customer
2. I use Restful GET to find the prospect customer. I got the returned prospect customer in the form of JSON.
3. I use Restful PUT to update the prospect customer. [In the backend, JPA used merge operation.]




4. For debugging, If I changed Customer to ProspectCustomer in Rest code as below, then it's OK for JPA code.



5. Now, if I want to keep Customer parameter (not ProspectCustomer) in my Rest code, then what need to be done in terms of correction?


===============================================================================

 
H Paul
Ranch Hand
Posts: 471
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Changed made to Code for point 3: JPA code . Worked.


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic