0 Replies Latest reply on Sep 6, 2007 11:32 AM by Earnest Dyke

    Value of identity column with JBoss 4.0.5 JPA entity manager

    Earnest Dyke Novice

      Greetings all,

      I have an EJB3 stateless bean that defines the following entity manager:

      @PersistenceUnit(unitName = "SimPersistence")
      EntityManager em;

      When I persist a new object via em.persist(o) I need to get the value of the identity column back. How can I do that? o.getId() returns 0. I have tried em.flush() followed by em.refresh(o) which did not work either.

      Any and all help is appreciated.