Tank you Il giorno 27/feb/2014 13.30, "ChrisChristo [via OpenEJB]" < [email protected]> ha scritto:
> If you have defined only one persistence unit in your config then openejb > will inject that into any bare @PersistenceContext annotations so you don't > need to be explicit by specifying the unit name with the annotation. If you > have multiple defined units in your config, then you must add the (unitName > ="movie-unit") to the annotation. > > > > On 27 Feb 2014, at 08:42, mauro2java2011 <[hidden > email]<http://user/SendEmail.jtp?type=node&node=4668010&i=0>> > wrote: > > > i know that for inject a EntityManager i have to write: > > > > > > @PersistenceContext(unitName = "movie-unit") > > private EntityManager entityManager; > > > > But from examples i have also found a different use: > > > > @PersistenceContex > > private EntityManager entityManager; > > > > when it is possible use it? > > > > > > > > > > -- > > View this message in context: > http://openejb.979440.n4.nabble.com/when-use-the-inject-EntityManager-without-specify-the-unitname-tp4668006.html > > Sent from the OpenEJB User mailing list archive at Nabble.com. > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://openejb.979440.n4.nabble.com/when-use-the-inject-EntityManager-without-specify-the-unitname-tp4668006p4668010.html > To unsubscribe from when use the inject EntityManager without specify the > unitname?, click > here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4668006&code=bWF1cm8yamF2YTIwMTFAZ21haWwuY29tfDQ2NjgwMDZ8LTExMTcxODc2MjU=> > . > NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://openejb.979440.n4.nabble.com/when-use-the-inject-EntityManager-without-specify-the-unitname-tp4668006p4668015.html Sent from the OpenEJB User mailing list archive at Nabble.com.
