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.
Add support for java.util.Optional, reflectively.  If the class exists, we bind
it the same way we bind com.google.common.base.Optional.  Update tests
accordingly.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=77215848
Merge pull request #859 from google/moe_writing_branch_from_74b915b1eaa6de6b5efcf905b346b24ff563bbbb

Merge internal changes
Issue #745: PathInfo not encoded
Merge pull request #860 from cstamas/issue-745-pathInfo-decode

Issue #745: PathInfo not encoded
Fix RequestDispatcherRequestWrapper inconsistency between `getRequestURI` and `getRequestURL`
Merge pull request #862 from backuitist/patch-1

Fix RequestDispatcherRequestWrapper inconsistency between `getRequestURI` and `getRequestURL`