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

Basic Concepts of Web Designing
An introduction to domain names, web servers, and website hosting 1)What is the web? In a nutshell, the web is a whole bunch of interconnected computers talking to one another. The computers (on the...

Observer Pattern in Java.
As I was going through the different source code files of the Java Util package, I found the implementation of the Observer Pattern ( see the Gang of Four books for more information on this pattern) in...

Java: A Quick Overview
Not purely Object Oriented: It doesn't support multiple inheritence, it supports primitive data types and static members. Doesn’t support multiple inheritance: Reason is diamond problem i.e.,...

doWhile example in Java
public class doWhilePracticleEx { public void test() { } public static void main(String args) { String q1 = "Who is PM of India?"; String a1 = "Sonia Gandhi"; String a2 = "Rahul Gandhi"; String a3...
S

Sarthak C.

0 0
0

Class, Object and Methods in JAVA
Lesson-1: Class, Object and Methods of Java can be compared with body, heart and brain. Without these 3 things, Java does not exist. If you Google the above 3 items, you will find many definitions. But...
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