2 Replies Latest reply on Jun 25, 2007 1:39 PM by limousyf

    EntityNotFoundException

    limousyf

      Hello,

      After modifying a seam-gen application, I have a weird error while trying to delete an object:


      javax.persistence.EntityNotFoundException: deleted entity passed to persist: [com.fitnetapplication.certifications.entity.Collaborateur#]

      When I go debug, the instance sent to getEntityManager().remove is correct

        • 1. Re: EntityNotFoundException
          ivan.tufegdzic

          probably that object has a foreign key with another objects. You should remove from that list,I think.

          • 2. Re: EntityNotFoundException
            limousyf

            You're right, the ManyToOne didn't have any cascade attribute set.
            Adding the CascadeType.ALL made the stuff work.
            It's a one-to-one in fact here, so I can cascade the remove, not sure what to do if it's really a many-to-one, set explicitly to cascade none ?
            Sounds weird ...
            Isn't cascade=none the default value for binding ?