xiaodududu / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Enhance guice-persist to allow external data sources #706

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I believe EntityManagerFactory expects a Map in its #createEntityManager call, 
on which you could provide an external java.sql.DataSource instance.

I would like to, within guice, @provide a DataSource, and on the same module, 
setup JpaPersistModule with this DataSource.

An enhancement: change java.util.Properties for the actually expected 
java.util.Map 

An issue: how to provide a DataSource, and then inject it to a Map, and then 
inject it to the actual JpaPersistModule?

Original issue reported on code.google.com by rgar...@dridco.com on 24 May 2012 at 2:16

GoogleCodeExporter commented 9 years ago
It could be achieved by allowing guice to create an EntityManagerFactory using 
the classes in javax.persistence.spi (PersistenceUnitInfo, 
PersistenceProvider...).

Original comment by xavier.d...@gmail.com on 27 Nov 2013 at 9:03