Tips for resolving Hibernate/JPA EntityNotFoundException
- by Damo
I'm running into a problem with Hibernate where when trying to delete a group of Entities I encounter the following error:
javax.persistence.EntityNotFoundException: deleted entity passed to persist: [com.locuslive.odyssey.entity.FreightInvoiceLine#<null>]
These are not normally so difficult to track down as they are usually caused by an entity being deleted but not being removed from a Collection that it is a member of.
In this case I have removed the entity from every list that I can think of (it's a complex datamodel). I've put JBoss logging into Trace and I can see the collections that are being cascaded. However I can't seem to find the Collection containing the entity that I'm deleting.
Does anyone have any tips for resolving this particular Exception?
Thanks.