3 Replies Latest reply on Apr 7, 2006 8:33 AM by Alex Palko

    em.merge generates

    Alex Palko Newbie

      I am using jboss-4.0.4.CR2 version and received the following situation

      I am trying to update object retrieved in previous phase.

      em.merge(persons);
      


      em.merge generates "insert" clause for persons (it is wrong behaviour of EJB3 Container) in case I define Persons with IdClass annotation
      @IdClass(com.p5soft.seb.ejb.data.model.PersonsPK.class)
      @Entity
      @Table(name="PERSONS")
      public class Persons implements Serializable {
      ...
      


      And em.merge generates "update" clause for persons (it is CORRECT behaviour of EJB3 Container) in case I define Persons without IdClass annotation

      @Entity
      @Table(name="PERSONS")
      public class Persons implements Serializable {
      



      But I have composite primary key for Persons.
      Is it possible to use merge for entities with @IdClass annotation?