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

How to create excel sheets using Java?
HSSFWorkbook workbook = new HSSFWorkbook();HSSFSheet sheet1 = workbook.createSheet("actions");for (int i = 0; i < 10; i++) { sheet1.createRow(i); for (int j = 0; j < 10; j++) { HSSFRow currRow =...

Lambda Expressions in Java
A lambda expression, introduced in Java 8 is similar to a block of code resembling an anonymous function that can be passed to constructors or methods for execution as an argument. Examples: a)() ->...

JAVA - Object Cloning
JAVA - Object Cloning Is the way of creating the same copy of object without calling the class constructor. It means we can make any class object multiple times without calling its default constructor....

On the Job training is always best
On the job training always provides an opportunity to learn the best industry practices. While you work on real time you would encounter many challenges that will force you to learn many new things. Class...
M

CoreJAVA
Core Java Training High Level Course Content Trained by Java Architect 1. Core Java Programming Introduction of Java 2. Data types and Operators 3. Control Flow statements 4. OOPS and its application...
A
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