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 <nigel.magnay@gmail.com>
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 <nigel.magnay@gmail.com>
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 <nigel.magnay@gmail.com>
Merge pull request #839 from magnayn/master

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