1 Reply Latest reply: Dec 4, 2012 4:53 PM by Timo Hahn RSS

    how to insert a row via creating an entity object instance


      I use the following code to create an entity instance.

      EntityDefImpl edImpl = EoChangesEOImpl.getDefinitionObject();
      eoImpl = (EoChangesEOImpl) edImpl.createInstance2(ei.getDBTransaction(), null);
      eoImpl.setEoId (idBuffer.toString());

      and the above codes will be called multiple time, so there will be multiple instance
      but I will just want to keep the last eoImpl object.
      I only call eoImpl.postChanges() at the end.

      And after postChanges, it create multiple-rows.
      Should eoImpl.postChanges() should just create a row of this object, not all the instances?
      How can I just create one row of the last eoImpl instance?