3 Replies Latest reply on Oct 27, 2008 1:04 AM by alrubinger

    How to pass PersistenceUnit name at run time

    yogesharora

      HI All,
      I want to enject entitymanager based on persistence unit name passed at runtime. Can any body tell how to do it.
      For Ex:
      @PersistenceUnit(name="xyz")
      EntityManager em;

      I want name to be populated at run time. (In above scenario it is hardcoded "xyz").