Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 491
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Changed made to Code for point 3: JPA code . Worked.


 
The only thing that kept the leeches off of me was this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic