Status: New
Owner: ----

New issue 547 by mingfai.ma: Provide a JpaPersistModule constructor with the properties argument
http://code.google.com/p/google-guice/issues/detail?id=547

I'm using the nightly build with guice-persist.

could JpaPersistModule allow us to set the "properties" field by providing a constructor as follows:

public final class JpaPersistModule extends PersistModule {
...
  public JpaPersistModule(String jpaUnit, Properties properties) {
    Preconditions.checkArgument(null != jpaUnit && !jpaUnit.isEmpty(),
        "JPA unit name must be a non-empty string.");
    this.jpaUnit = jpaUnit;
    this.properties = properties;
  }
...
}

Let's say we have a data project that other app projects will depend on it. Ideally, only the data project has the persistence.xml and any JPA configurations. And the data project will provide a module that install the JpaPersistModule and expose Dao/EntityManager etc. to other projects.

The first problem is, it seems I have to put a persistence.xml in every project to work. There might be a better way but I won't tackle this problem for now.

Assume I'll put persistence.xml in every app project, I don't want to duplication the JPA properties like jdbc url, user, password etc. If the JpaPersistModule provides a 2nd constructor, it could fix this problem.

thanks

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" 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-dev?hl=en.

Reply via email to