ghazala (3) [Avatar] Offline

I am little confused about JPA services and its implementation. In EJB3 in Action , it says JPA standardizes the ORM framework so that you can run your code with any persistence provider.I am not clear yet that :

1) does JPA not provide implemention for its services i.e EntityManager and cannot be used without persistence provider i.e (Hibernate or Toplink) ?

2) It also says JPA can be used without container ,so it means if we are using container or app server for example jboss , then hibernate jars are already included in jboss and we need not to include hibernate jars in classpath ?

3) If we are using JPA without container i.e in a desktop application,then we need to include hibernate jars in classpath to get the persistence privider or get the implementation of JPA ?

Please clearify.

dpanda (136) [Avatar] Offline
Re: JPA implementation
1. Yes, JPA requires a persistence provider. Any Java EE 5 implementation has to provided a JPA implementation

2. JBoss includes the JPA and Hibernate jars and you don't have to do anything special.

3. Yes. See an example provided in chapter 12, how to use JPA from Java SE