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

    How to pass PersistenceUnit name at run time

    Yogesh Kumar Newbie

      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").