Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Table per concrete class is throwing org.hibernate.NonUniqueObjectException:

 
VenkataPrasad Regula
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an abstract class and two concrete class which extend these abstract class. I have mapped all the three in a employee.hbm.xml file. It is throwing the following error. My db is mysql
Exception in thread "main" org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [temp.ContractEmployee#0]
.
Could someone kindly look into it.

Abstract Class


Extended Class 1

Extended Class 2


MainClass

employee.hbm.xml file



 
Arun Kumarr
Ranch Hand
Posts: 661
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
your primary key is "assigned"?
Where are you setting your primary key?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic