What are the differences / similarities between sleeping and other structures or specifications?

I want to know the differences / similarities between Hibernate and simple persistence in Java EE 5?

I don’t understand if Hibernate implements a Java EE 5 persistence implementation or if this is a completely different approach to representing data on internal systems.

I am confused by Hibernate and its relation to the concepts of Java security provided in the Java EE 5 tutorial ... Can you clarify the role of Hibernate in the context of Entities and EJB?

Also, I want to know other approaches (frameworks) like JPA or Spring ...

0
java-ee hibernate jpa persistence java-ee-5
source share
5 answers

I want to know the differences / similarities between Hibernate and simple persistence in Java EE 5?

Standardized Java API EE 5 retention is JPA 1.0 and is a kind of unified version of the API and EJB 2 CMP, JDO, Hibernate, and TopLink products. Hibernate is an ORM structure that precedes JPA and has greatly influenced the JPA specification (the creator of Hibernate is part of an expert group behind JPA). Just keep in mind that JPA is just an API, you need a JPA implementation to use it.

I don’t understand if Hibernate implements a Java EE 5 persistence implementation or if this is a completely different approach to representing data on internal systems.

Yes, Hibernate provides a JPA implementation (and also extends it; Hibernate is a superset of JPA) through the Hibernate EntityManager project (which relies on Hibernate Core).

I am confused by Hibernate and its relation to the concepts of Java security provided in the Java EE 5 tutorial ... Can you clarify the role of Hibernate in the context of Entities and EJB?

Hibernate can be used as a provider for preserving JPA duration, i.e. as part of the code that actually stores EJB 3 objects (the JPA specification was part of the EJB 3.0 specification in version 1.0, now it's a separate specification)

Also, I want to know other approaches (frameworks) like JPA or Spring ...

Spring is not the foundation of conservation, Spring is an IoC container, it does not compete with Hibernate.

Hibernate's corresponding JPA alternatives include TopLink Essentials (RI in Java EE 5), EclipseLink (which is also RI JPA 2.0 in Java EE 6), OpenJPA, DataNucleus.

Other save options are JDO (another standardized save API), iBATIS (not ORM, it's more like data mapping), JDBC (low level API) to reference the most famous.

Check out this previous answer for a review and some historical background.

+4
source share

Check out this diagram from http://www.hibernate.org :

alt text

In the past, in the ancient days of J2EE, Hibernate was a major player in the world of persistence. There were competitors, but the permanent code was not exchangeable. Later, when Java EE 5, the successor to J2EE, was under development, the new Java Persistence API (JPA) was defined using Hibernate's lead collaborator, Gavin King, to further abstract persistence and put it in a single contract. Thus, you can easily select and share the JPA implementation without changing the code (as, for example, in the JDBC API). Currently, under each JPA Hibernate , EclipseLink (formerly known as TopLink) and OpenJPA, there are JPA implementations.

I think your confusion actually occurs between the "good old" Hibernate and the modern Hibernate JPA. Hope that cleared up now.

+1
source share

When the JPA (Java EE 5 Retention Standard) was developed by the JCP expert group (JSR 220), many ideas were adopted from the existing Hibernate (also from JDO). Gavin King, founder of Hibernate himself, was part of a panel of experts and others.

After the final JPA specification was published, Hibernate became its open source version (starting with version 3.2). Hibernate still has a richer feature set and typically generates new features faster because the open source development process is generally faster than the Java community process.

Other JPA implementations:

  • DataNucleus
  • Eclipselink
  • Openjpa

Other approaches:

  • FROM TO
  • Ibatis
  • plain jdbc
+1
source share

The JPA specification described in EE5 is only a specification. This means that this is not a product. JPA is just a set of definitions that different vendors must fulfill in order to be a "JPA Complaint"

Hibernate is another “plug-in” continuity provider, which means that this product implements the definitions defined by the JPA specification. You can find other similar products, such as TopLink or Apache OpenJPA.

That's all.

0
source share

A bit off topic, but JPA implies session-oriented architecture. This is your beans attached / detached to the EntityManager, and you save / merge / clear the entityManager.

If you are looking for a “session-based” approach to ORM (without persist / merge / flush attached / detached), you can also look at Ebean ORM, which also uses JPA Annotations for matching. You can also describe it as "Ebean provides automatic persistence context management."

0
source share

All Articles