0 Replies Latest reply on Jan 8, 2006 12:07 PM by Sven Linstaedt

    Entity removal via @Remove

    Sven Linstaedt Newbie

      Hi,

      maybe somebody can help me: As it is mentioned in the EJB3 Trailblazers [http://trailblazer.demo.jboss.com/EJB3Trail/persistence/entitylifecycle/index.html],
      you can annotate an entity method with @Remove so it would be removed from EntityContext when called. But the EJB3 persistence specs does not mention a mechanism like the above and as far as I can see, @Remove annotated methods do not remove the entity.

      I believe the Trailblazers are incorrect in this point. So is there a solution for removing an entity from its EntityContext from the entity itself? I have a scenario like

      public class Entity {
      
       public methodXXX() {
       remove();
       }
      
       public remove() {
       // remove this entity from EntityContext
       }
      }
      


      Annotating the method remove() with @Remove would have been a very nive solution, but it did not work.