Apache Onami Persistence is a Google Guice extension for JPA with support of container managed persistence units and transactions..
Onami-Persist is available on the Maven Central repo, you just need to add the dependency below in your pom.xml file:
<dependencies> ... <dependency> <groupId>org.apache.onami</groupId> <artifactId>org.apache.onami.persist</artifactId> <version>1.0.1</version> </dependency> ... </dependencies>
The official guice extension guice-persist allows to configure and inject a persistence unit into your classes. Guice-persist assumes that only one persistence unit is used in an application and that this persistence unit is application managed. Onami-Persist overcomes this shortcoming.
Here you find a sample code of how a DAO or service may look if it uses guice-jpa
If you have used guice-persist before you may be interested in the differences between guice-jpa and guice-persist.
The most difficult part to get right is the configuration and setup of the persistence unit. Some examples are provided: