aspose file tools*
The moose likes Object Relational Mapping and the fly likes Merge detached sub-class entity (JPA InheritanceType.SINGLE_TABLE) org.hibernate.WrongClassException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Merge detached sub-class entity (JPA InheritanceType.SINGLE_TABLE) org.hibernate.WrongClassException" Watch "Merge detached sub-class entity (JPA InheritanceType.SINGLE_TABLE) org.hibernate.WrongClassException" New topic
Author

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

H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 471
    
    4
(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

Joined: Jul 26, 2011
Posts: 471
    
    4
Changed made to Code for point 3: JPA code . Worked.


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Merge detached sub-class entity (JPA InheritanceType.SINGLE_TABLE) org.hibernate.WrongClassException