I think that, in the scope of SCEA, you need to focus on JPA (Java Persistence APA, a specification, part of EJB 3.0). The implementations of this specification are Hibernate, Toplink, Kodo, etc... and you don't need to study them in details.
They are alternatives (or extensions) to JPA, and as a Java Architect, you must know that they exist.
Beno�t [ December 11, 2008: Message edited by: Beno�t de CHATEAUVIEUX ]
SCJP5 | SCBCD5 | SCEA5 Part 1
Joined: Jul 05, 2005
I don't get why people keep saying Hibernate is an implementation of JPA which is incorrect.
"The Java Persistence API draws upon the best ideas from persistence technologies such as Hibernate, TopLink, and JDO." "The Java Persistence API is not based on any single existing persistence framework but incorporates--and improves upon--ideas contributed by many popular frameworks, including Hibernate, TopLink, JDO, and others." http://java.sun.com/javaee/overview/faq/persistence.jsp
Hibernate, TopLink, JDO *are not* implementations of JPA, but JPA was created based on them.
Hibernate, TopLink have their own interfaces/API, they implement their own API, they exist before JPA, how come they are implementations of JPA? [ December 11, 2008: Message edited by: Kengkaj Sathianpantarit ]
Benoît de Chateauvieux
Joined: Aug 10, 2007
You are right: JPA is based on the experience of the first ORM projects (like Hibernate, which appeared years before JPA).
But as JPA provides only interfaces and Hibernate provides the classes, Hibernate (and Toplink, Kodo, etc.) are implementations of JPA.
Hibernates is a standalone ORM framework too, and has powerful functionalities that are not part of the JPA specification.
The Java Persistence API is the standard object/relational mapping and persistence management interface of the Java EE 5.0 platform. As part of the EJB 3.0 specification effort, it is supported by all major vendors of the Java industry.
Hibernate implements the Java Persistence object/relational mapping and persistence management interfaces with the Hibernate Annotations and Hibernate EntityManager modules, on top of the mature and powerful Hibernate Core.
Joined: Jul 05, 2005
Thanks for information, Beno�t.
Actually, you should bold entire paragraph to make it more clear. Hibernate implements the Java Persistence object/relational mapping and persistence management interfaces with the Hibernate Annotations and Hibernate EntityManager modules, on top of the mature and powerful Hibernate Core.
This sentence doesn't state that Hibernate as a whole is an implementation of JPA.
But currently, Hibernate has more components to make it conform with JPA, say Hibernate Annotations and Hibernate Entity Manager.
Hibernate Entity Manager is actually just a wrapper to Hibernate Core. "Hibernate EntityManager wraps the powerful and mature Hibernate Core. You can fall back to Hibernate native APIs, native SQL, and native JDBC whenever necessary." http://www.hibernate.org/397.html
In other word, it's just an implementation of Adapter pattern to allow clients to use JPA with Hibernate.
So, in my opinion, Hibernate as a whole is not an implementation of JPA.
Hibernate Core has its own API, and Hibernate EntityManager (a module of Hibernate) implements JPA, and wraps Hibernate Core.
I totally agree, if we say Hibernate EntityManager is an implementation of JPA, or Hibernate EntityManager is a wrapper of Hibernate Core.
But I don't think it is right to say that, "Hibernate" is an implementation of JPA.
This may cause headache, because Hibernate was mature before JPA was adopted.
Another example to make my explanation more clear. I think it's incorrect to say that JDK is an implementation of Collection Framework API, just because Java Collection Framework (a part of JDK) is an implementation of Collection Framework API. [ December 12, 2008: Message edited by: Kengkaj Sathianpantarit ]