• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deleting the object with @OneToOne mapping.

 
Faiz Chachiya
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have entity Aircraft and FlightData, which have one-to-one relationship (i.e one Aircraft can have one FlightData).

The Aircraft class is as below.




The FlightData class is as below.




I am able to Add/Update the FlightData, but when i try to delete the flight data i get the following exception


org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascad
e (remove deleted object from associations): [org.woi.dao.FlightData#4]
at org.hibernate.impl.SessionImpl.forceFlush(SessionImpl.java:1041)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTran
sient(DefaultSaveOrUpdateEventListener.java:188)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveO
rUpdate(DefaultSaveOrUpdateEventListener.java:117)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpda
te(DefaultSaveOrUpdateEventListener.java:93)




Does anyone has any idea, what is causing this error.



---Faiz.








 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic