[jboss-user] [JBoss Seam] - using JPA vs. Hibernate with SEAM apps
asookazian
do-not-reply at jboss.com
Mon Jan 21 13:48:39 EST 2008
according to EJB3 in Action by Debu et al, "JPA is now the standard API to build the persistence tier for applications." - pg. 533
What are the advantages/disadvantages of using Hibernate (e.g. Session interface) vs. JPA (e.g. EntityManager interface) knowing that JPA is a sub-set of Hibernate API? I'm assuming you get more functionality with Hibernate API.
http://www.hibernate.org/hib_docs/v3/api/org/hibernate/Session.html
http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityManager.html
We are currently using JPA with Hibernate as the persistence provider (vs. Toplink). This is different from using Hibernate API's exclusively with no EntityManager references, etc.
persistence.xml snippet:
| <persistence-unit name="boIcomsSecurityAudit">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/boIcomsSecurityAuditDatasource</jta-data-source>
| <properties>
| <property name="jboss.entity.manager.factory.jndi.name" value="java:/securityAuditBoIcomsEntityManagerFactory"/>
| </properties>
| </persistence-unit>
What is the official JBoss Seam recommendation for Seam apps? Should we use Hibernate API directly or JPA? I have a feeling it's one of the "it depends" answers. Most of the examples I've seen in the Seam books use the EntityManager interface for JPA. thx.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4121926#4121926
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4121926
More information about the jboss-user
mailing list