Hibernate
From Resin 3.0
Hibernate with the JPA (EntityManager) interface requires Resin 3.1.4 or later.
You will need to copy the jars from both hibernate and hibernate-entitymanager. The persistence.xml in META-INF/persistence.xml will need to specify the HibernatePersistence provider, e.g.
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"> <persistence-unit name="test"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>jdbc/database</jta-data-source> <properties> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.ResinTransactionManagerLookup"/> </properties> </persistence>
Your servlet or WebBean can use @In EntityManagerFactory (or @Named("test") or @PersistenceUnit(unitName="test")) to get the EntityManager
import javax.persistence.*; import javax.transaction.*; import javax.webbeans.*; public class MyServlet extends GenericServlet { @Named("test") EntityManagerFactory _factory; @In UserTransaction _ut; ... }