File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes ProJPA2 book Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "ProJPA2 book" Watch "ProJPA2 book" New topic

ProJPA2 book

Emmanuel Garcia

Joined: Feb 24, 2009
Posts: 12

I a newby with EJB3.0 but I have worked wiith Hibernate and its persistence API and I know Spring and I can see that Spring uses
persistence with Hibernate, Ibatiz or JPA.

My questions are, if you want to work with JPA ,Is it tied with EJB 3.0? Can I work with JPA without work with EJBs ?

I believe thath JPA is a API as such JDBC, only interfaces, the implementation can be with Hibernate or openJPA, Is it correct ?

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

Yes. There are implementations that having nothing to do with EJB or application servers

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Mike Keith
Ranch Hand

Joined: Jul 14, 2005
Posts: 304
The fact that Spring offers integration with JPA is a good indicator that JPA works without EJB.

JPA was initially developed within the EJB 3.0 expert group and released as a separate document but as part of the EJB 3.0 spec (that is why the previous book was called "Pro EJB 3: Java Persistence API"). Although JPA could always be used independent of EJB, when JPA 2.0 work began it was as a completely separate expert group, making its independence from EJB more obvious. Think of it as a portable persistence API equivalent to Hibernate, but that has additional integration support built right into all of the existing Java EE components, plus Spring, Google App Engine, or any other popular Java container/framework.

Every popular persistence implementation implements it, with 3 major open source products among them: Hibernate, EclipseLink and OpenJPA. EclipseLink is the only one that is currently compliant with JPA 2.0, but the others will definitely follow. The key advantage of using JPA is that your application is not bound to a particular implementation because the JPA spec defines a way for the implementations to be transparently plugged in under the covers.

Pro JPA 2: Mastering the Java Persistence API
Emmanuel Garcia

Joined: Feb 24, 2009
Posts: 12
Thanks Mike and thanks Jeanne Boyarsky for you comment.

I agree. Here's the link:
subject: ProJPA2 book
jQuery in Action, 3rd edition