Luiz, Give a look at http://code.google.com/p/google-guice/wiki/JPA, it may help you.
*Jayr Motta* On Mon, Sep 26, 2011 at 5:53 PM, Luiz Eduardo <[email protected] > wrote: > hi all > > i'm instantiating my entityManager like this: > https://gist.github.com/**1243361 <https://gist.github.com/1243361> > > and my module that inject the entityManager inside my repos is like this: > > @Override > protected void configure() { > bind(PapelRepository.class).**to(PapelRepostitoryImpl.class)** > .in(Scopes.SINGLETON); > bind(UsuarioRepository.class).**to(UsuarioRepositroyImpl.** > class).in(Scopes.SINGLETON); > bind(EmpresaRepository.class).**to(EmpresaRepositoryImpl.** > class).in(Scopes.SINGLETON); > } > > @Provides > public EntityManager getEntityManger(){ > return ECFEntityManager.**createEntityManager(); > } > > > but if i remove the ThreadLocal from my entityManagerFactory, the whole > thing just doesn't work (e.g: transcations aren't commited) > > ps: this is an RCP (OSGi) app, and i'm installing peaberry module like this > > > Module mod = new AbstractModule() { > > @Override > protected void configure() { > install(Peaberry.osgiModule(**context)); > } > }; > > injector = Guice.createInjector(mod, new GermantechModulo()); > > any ideas? thanks in advice > > -- > You received this message because you are subscribed to the Google Groups > "google-guice" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to google-guice+unsubscribe@** > googlegroups.com <google-guice%[email protected]>. > For more options, visit this group at http://groups.google.com/** > group/google-guice?hl=en<http://groups.google.com/group/google-guice?hl=en> > . > > -- You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.
