The @PersistenceContext annotation is like the @Inject for EM. If you have only one persistence unit, you don't need to use it, the EM will be passed to the constructor by the registry. If you have multiple persistence unit as it seems that you do, you have to annotate the constructor parameter with the @PersistenceContext annotation.
As for the persistence.xml file, I prefer to have it in the src/main/ *resources*/META-INF/persistence.xml as it is not a java file but it should work also. Le jeu. 23 avr. 2015 à 14:54, Thiago H de Paula Figueiredo < thiag...@gmail.com> a écrit : > On Thu, 23 Apr 2015 08:46:53 -0300, Poggenpohl, Daniel > <daniel.poggenp...@isst.fraunhofer.de> wrote: > > > Hi, > > > > thank you for your time, but I still have more questions... > > e) Are the [...]Module classes to be placed in the services package in > > the Tapestry app module? > > The package doesn't matter, unless in the case described below. > > > f) Is the naming important? Or could I have a FooModule class without > > having a Foo module? > > Naming is only important for the Tapestry-IoC module class which is > automatically loaded by the webapp, as it should be [name of the > TapestryFilter in web.xml]Module. The Tapestry servlet filter it's usually > declared as being named 'app', so that's why the AppModule naming > convention exists. > > As Charlouze said, for services, the recommended way of doing dependency > injection is through the constructor. No @Inject annotation needed. > Tapestry-IoC just picks the constructor with the most parameters and > treats each one as a service to be injected. This way, you can create > Tapestry-IoC services which don't depend on Tapestry-IoC in any way, not > even annotations. > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >