The difference between ORM and JPA on Java

Asked By 0 points N/A Posted on -
qa-featured

Good day, brother.

As the title suggests that I ask what the difference ORM and JPA?

Previously I've been looking myself, but still confused.

In my mind anyway, JPA is one kind of / sort of framework for ORM like Hibernate so. But I still doubt. Can anyone enlighten?

SHARE
Best Answer by skyins
Best Answer
Best Answer
Answered By 0 points N/A #85587

The difference between ORM and JPA on Java

qa-featured

Java persistence API, also known as JPA, is java programming language framework that allows developers to managing data relationships in the Java platform Standard Edition (J2SE) and Java Platform Enterprise Edition (J2EE). JPA comes from the JSR 220 Expert Group.
Persistence consists of three parts:

  •  API is in the package javax.persistence
  •  Persistence query language
  •  The object / relational metadata

In the Documentation J2SE (Desktop application), it is noted that JSR 220 specification defines Enterprise JavaBeans 3.0. One of the goals The main is to simplify the creation, management, and save the entity. In achieving that goal, Sun Microsystems and application developer community makes the program interface (API) lets you use "plain old Java objects" or POJOs as persistable entities. Java persistence API facilitates the use of POJOs as entity beans and significantly reduce the complexity in make the time deployment descriptor bean and get additional assistance. In addition, it can even use the API in desktop applications.

You will find many reasons to use persistence The new APIs, here are just a few:

• You do not need to make complex data access objects (DAO).
    · API helps manage the transaction.
    · Standards-writing code that interacts with a relational database, separated from the database query that is used.
• You can avoid writing SQL query language using the class name and property.
• You can use and manage POJOs.

You can also use the Java persistence API for applications desktop. Persistence in Java into the Java Persistence API or JPA. JPA have the ability severe enough project that is really not dealing with the database. table will be made by the JPA.

Some things to note:

1. We just need to understand Object Oriented approach
2. Table in the database will be generated automatically Based on the entity class that we make.
3. There are several libraries that JPA can be used, among others, TopLink and Hibernate.

Another sense of the JPA is one of the Java framework approach Object-relational mapping (ORM). Birth of ORM motivated by the perspective of OOP in the real world to see system, including into the database system. The workings of this ORM is to map objects into the database. Objects that included will be read by the ORM and converted into SQL syntax.

The next and then executed in the relational database and the results back to the ORM. Various kinds of technologies that use this approach such as Entity Beans 2.x, Toplink, Hibernate, JDO, JDBC with DAO. With so many choices of technology, making Java EE expert inspired by creating a framework known as the Java Persistence API (JPA).

JPA is a new feature being added from the Java EE 5 and is a sub-specification of EJB 3. In addition to Java EE, JPA can also used to build Java-based applications .

Regards,

John Rick

Answered By 0 points N/A #85589

The difference between ORM and JPA on Java

qa-featured

I was very encouraged to find this solution.

The reason being that this is such an informative post.

I wanted to thank you for this informative analysis of the subject.

Now I know the difference ORM and JPA on Java.

Thanks a lot   Skyins

Login/Register to Answer

Related Questions