• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error Detached entity passed to persisit

 
sshruti dere
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to hibernate. I have written a simple program with four files in it.
Employee.java it is a bean class with getters n setters in it.
hibernate.cfg.xml



Employee.hbm.xml



StoreData.java


I have created table using the following sql statement
create table employee (empid number(2,2),empname VARCHAR2(30), empdept varchar2(10), empsal number(5,2));

But when I run this program i get the following error:
org.hibernate.PersistentObjectException: detached entity passed to persist: hibernate_prj.Employee

Please help to resolve this
 
amit punekar
Ranch Hand
Posts: 544
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!