Deep Dive on Spring Boot and JPA Implementation: A to Z

Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can “just run”.

Photo by Tracy Adams on Unsplash

Setup of JPA & H2 Database

Entity design and save, update and delete

Save/Update Customer in table

Hibernate: 
insert
into
customer
(id, first_name, gender, last_name, mobile_number, present_address, permanent_address)
values
(null, ?, ?, ?, ?, ?, ?)

Fetch Data based on mobileNumber

2021–03–24 00:31:49.104 INFO 10713 — — [nio-8081-exec-6] o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory
Hibernate:
select
customer0_.id as id1_0_,
customer0_.first_name as first_na2_0_,
customer0_.gender as gender3_0_,
customer0_.last_name as last_nam4_0_,
customer0_.mobile_number as mobile_n5_0_,
customer0_.present_address as present_6_0_,
customer0_.permanent_address as permanen7_0_
from
customer customer0_
where
customer0_.mobile_number=?

Fetch Specific column from the table

Now the actual query will be
Hibernate:
select
customer0_.id as col_0_0_,
customer0_.first_name as col_1_0_,
customer0_.last_name as col_2_0_,
customer0_.mobile_number as col_3_0_
from
customer customer0_
where
customer0_.first_name=?

Pagination based query

Back-end developer, Spring, JAVA, Distributed system, AWS, Google Cloud, Docker, CD/CI, Kubernetes, databases. https://www.linkedin.com/in/sajedulkarim/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store