UrbanPro
true

Learn Java Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Implementation: What Is JPA And JPA?

Jayant Kumar
23/12/2017 0 0

The basic Java framework to access the database is JDBC. Unfortunately, with JDBC, a lot of hand work is needed to convert a database query result into Java classes.

JPA allows us to work with Java classes as it provides a transparent layer to each database specific details; JPA will do the hard work of mapping table to class structure and semantics for the developer.

An easy definition to JPA is: “A group of specifications (a lot of texts, regularizations and Java Interfaces) to define how a JPA implementation should behave”. There are many JPA implementations available both free and paid, e.g. Hibernate, OpenJPA, EclipseLink and the “new born” Batoo etc.

Most JPA implementations are free to add extra codes, annotations that are not present in the JPA specification, but must conform to the JPA specification scemantics.

The main JPA feature to address application portability is the ability to map database tables into the classes. In the following sections we will demonstrate how it is possible to map the column of a table into a Java class field regardless of the names of both the batabase column and Java class field.

JPA created a database language named JPQL to perform database queries. The advantage of JPQL is that the query can be executed in all databases.

SELECT id, name, color, age, doors FROM Car

The query above could be translated to the JPQL below:

SELECT c FROM Car c

Notice that the result of the query above is “c”, that means, a car object and not the fields/values found in the database table. JPA will create the object automatically.

JPA will be responsible to translate the JPQL query to the database native query; the developer will not need to worry about which is the required sql database syntax.

0 Dislike
Follow 2

Please Enter a comment

Submit

Other Lessons for You

Finding a Majority Element
Problem Description Task. The goal in this code problem is to check whether an input sequence contains a majority element. Input Format. The first line contains an integer, the next one contains a sequence...

Try to clear up the basics, if basics are clear then you can go ahead with any difficult problem
Hey guys, To all the students i just want to convey that just clear up your basics so that they can help you solve anyu problem and you would achieve a great success. Regards, Ishani Chakraborty

Java8 Filters and collectors
Lets say we have collection of strings and we would like to filter (remove) out certain strings from collection. We could achive the same in java 7 and earlier versions import java.util.ArrayList; import...

Introduction to Course Content
Video about what we are going to learn throughout the Java Training Session .

Differences Between HashMap vs HashSet In Java.
HashSet HashMap HashSet implements Set interface. HashMap implements Map interface. HashSet stores the data as objects. HashMap stores the data as key-value pairs. HashSet...
X

Looking for Java Training Classes?

The best tutors for Java Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Java Training with the Best Tutors

The best Tutors for Java Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more