3 Replies Latest reply on Feb 23, 2006 9:22 AM by Jens Elkner

    @persistencecontext: name or unitName?

    Michael Newcomb Newbie

      From EJB 3.0 spec:

      The name element refers to the name by which the EntityManager and its persistence unit are to be known in the environment referencing context, and is not needed when dependency injection is used.

      The unitName element refers to the name of the persistence unit. It must be specified if there is more than one persistence unit within the referencing scope.


      I thought the whole idea of this annotation was for the purpose of dependency injection, so that would mean that 'name' would never be used?

      And how do I get more than one persistence unit within the referencing scope? Only 1 persistence.xml per par/jar correct?

      Thanks,
      Michael