Branch: refs/heads/master
  Home:   https://github.com/google/guice
  Commit: 6084d8fa072e9d29dcd099af1255d5b5a5f2f1c3
      
https://github.com/google/guice/commit/6084d8fa072e9d29dcd099af1255d5b5a5f2f1c3
  Author: Nigel Magnay <[email protected]>
  Date:   2014-10-07 (Tue, 07 Oct 2014)

  Changed paths:
    M extensions/persist/src/com/google/inject/persist/jpa/JpaPersistModule.java
    M 
extensions/persist/src/com/google/inject/persist/jpa/JpaPersistService.java

  Log Message:
  -----------
  Allow JPA properties to be Objects as well as simple strings.

JpaPersistService takes a parameter thus:
   Properties persistenceProperties

However, this is used later to create an entity manager:
  Persistence.createEntityManagerFactory(persistenceUnitName,
                                   persistenceProperties);

The signature for that method is (String, Map) NOT (String, Properties).

If one is using Hibernate, you can pass the desired DataSource object in
using that Map with Environment.DATASOURCE storing the actual object.
Clearly you cannot do that if it's Properties (String->String map)

Changing this so that the persistenceProperties is a Map would solves this,
so you may now do (for example)

  DataSource ds = ...;
  Map p = new HashMap();
  p.put( Environment.DATASOURCE, ds );
  JpaPersistModule jpaPersistModule = new JpaPersistModule("myapp-db")
                                    .properties(p);

Since all Properties objects *are* Map instances, this is a non-breaking
change.

Signed-off-by: Nigel Magnay <[email protected]>


  Commit: aa2f2dc625cb5cc26a2782479790dd80a00353cc
      
https://github.com/google/guice/commit/aa2f2dc625cb5cc26a2782479790dd80a00353cc
  Author: Nigel Magnay <[email protected]>
  Date:   2014-10-07 (Tue, 07 Oct 2014)

  Changed paths:
    M extensions/persist/pom.xml
    M 
extensions/persist/test/com/google/inject/persist/jpa/JpaWorkManagerTest.java

  Log Message:
  -----------
  Update tests to use JPA 2.0.

Stopping the persistence service now causes a 'service not registered'
exception, hence catch that as it is not an error.

Signed-off-by: Nigel Magnay <[email protected]>


  Commit: d8d58191efd47e0f58fc90c33a68c424a0de35ab
      
https://github.com/google/guice/commit/d8d58191efd47e0f58fc90c33a68c424a0de35ab
  Author: Nigel Magnay <[email protected]>
  Date:   2014-10-07 (Tue, 07 Oct 2014)

  Changed paths:
    M extensions/persist/test/META-INF/persistence.xml
    A 
extensions/persist/test/com/google/inject/persist/jpa/EnsureJpaCanTakeObjectsInPropertiesTest.java

  Log Message:
  -----------
  Introduce a test that shows a JPA provider being passed a datasource
from guice in a map, rather than from the persistence.xml file.

Note that this requires a modern version of hibernate since older versions
did not correctly process passed objects.

Signed-off-by: Nigel Magnay <[email protected]>


  Commit: d1358898419a9e596d7f15e56a897976bb267fe0
      
https://github.com/google/guice/commit/d1358898419a9e596d7f15e56a897976bb267fe0
  Author: Sam Berlin <[email protected]>
  Date:   2014-10-07 (Tue, 07 Oct 2014)

  Changed paths:
    M extensions/persist/pom.xml
    M extensions/persist/src/com/google/inject/persist/jpa/JpaPersistModule.java
    M 
extensions/persist/src/com/google/inject/persist/jpa/JpaPersistService.java
    M extensions/persist/test/META-INF/persistence.xml
    A 
extensions/persist/test/com/google/inject/persist/jpa/EnsureJpaCanTakeObjectsInPropertiesTest.java
    M 
extensions/persist/test/com/google/inject/persist/jpa/JpaWorkManagerTest.java

  Log Message:
  -----------
  Merge pull request #839 from magnayn/master

Allow JPA properties to be Objects as well as simple strings.


Compare: https://github.com/google/guice/compare/3f1d2e4d65a6...d1358898419a

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice-dev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to