Wednesday, May 23, 2018

What is Spring Boot JPA?


 
spring boot jpa

What is Spring Boot JPA?

Java Persistance API is a specification that provides an easy way of mapping from java object to relational mapping

Why JPA?

The java bean what we try to insert into database needs to be converted into single relational row that can fit into a table, This was all taken care by ORM's (Object - relational mapping), still the problem persists as the conversion had too much of boiler plate code,JDBC Connections, Creating statements,prepared statements,hard coding the queries,looping over results sets etc, it was not really sophisticated and simple, Hence JPA.

How is it simple using JPA now??

Spring Data JPA made it more easy to map the object to relational values, usually DAO layer contains all the information about contacting with the databases, All the boilerplate code that we were writing removed completely by just an interface(not even implementation).

YES,Just an interface, Dont get confused, How it is implemented is in coming chapters!!

To use a Spring Data JPA,add the following dependency

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

Share:

1 comment:

  1. This is what I have been looking for,thanks for the source code,it's working like a charm

    ReplyDelete