On Mon, Sep 29, 2008 at 9:06 AM, Adam Ruggles <[EMAIL PROTECTED]> wrote:

>
> I still don't see a way to inject a datasource into the
> entitymanager.  I'd like to keep the database connection information
> out of the persistence.xml.


If you are using Hibernate you can configure the following properties:

hibernate.connection.driver_class
hibernate.connection.url
hibernate.connection.username
hibernate.connection.password

hibernate.connection.pool_size

And simply bind them as follows:
bind(Properties.class).toInstance(...<an obj with the above props>...);

warp-persist will detect the bound props and configure JPA to use the
datasource specified there. You are free to store those props anywhere you
like (e.g. in a resource bundle).

Dhanji.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to