Java Persistence API (JPA) Repository Overview And Custom Queries

Vue JS and Spring Boot Microservices and Spring Cloud User Service - (Spring Boot, MySQL, Liquibase...)
3 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€59.77
List Price:  €85.39
You save:  €25.62
£50.93
List Price:  £72.77
You save:  £21.83
CA$95.55
List Price:  CA$136.50
You save:  CA$40.95
A$106.98
List Price:  A$152.84
You save:  A$45.85
S$89.26
List Price:  S$127.52
You save:  S$38.26
HK$549.41
List Price:  HK$784.91
You save:  HK$235.49
CHF 55.87
List Price:  CHF 79.82
You save:  CHF 23.94
NOK kr703.78
List Price:  NOK kr1,005.44
You save:  NOK kr301.66
DKK kr445.95
List Price:  DKK kr637.10
You save:  DKK kr191.15
NZ$115.35
List Price:  NZ$164.80
You save:  NZ$49.44
د.إ257.03
List Price:  د.إ367.21
You save:  د.إ110.17
৳8,576.75
List Price:  ৳12,253.02
You save:  ৳3,676.27
₹5,983.29
List Price:  ₹8,547.93
You save:  ₹2,564.63
RM295.95
List Price:  RM422.80
You save:  RM126.85
₦108,352.21
List Price:  ₦154,795.51
You save:  ₦46,443.30
₨19,889.01
List Price:  ₨28,414.09
You save:  ₨8,525.08
฿2,282.93
List Price:  ฿3,261.47
You save:  ฿978.54
₺2,791.51
List Price:  ₺3,988.05
You save:  ₺1,196.53
B$384.15
List Price:  B$548.81
You save:  B$164.66
R1,251.78
List Price:  R1,788.33
You save:  R536.55
Лв116.89
List Price:  Лв167
You save:  Лв50.10
₩95,137.09
List Price:  ₩135,915.96
You save:  ₩40,778.86
₪236.70
List Price:  ₪338.16
You save:  ₪101.46
₱3,961.57
List Price:  ₱5,659.63
You save:  ₱1,698.06
¥10,112.90
List Price:  ¥14,447.62
You save:  ¥4,334.72
MX$1,321.08
List Price:  MX$1,887.34
You save:  MX$566.26
QR256.41
List Price:  QR366.32
You save:  QR109.90
P931.37
List Price:  P1,330.58
You save:  P399.21
KSh9,064.04
List Price:  KSh12,949.19
You save:  KSh3,885.14
E£3,492.09
List Price:  E£4,988.92
You save:  E£1,496.82
ብር9,663.94
List Price:  ብር13,806.22
You save:  ብር4,142.28
Kz63,827.73
List Price:  Kz91,186.38
You save:  Kz27,358.65
CLP$65,194.98
List Price:  CLP$93,139.68
You save:  CLP$27,944.70
CN¥501.78
List Price:  CN¥716.86
You save:  CN¥215.08
RD$4,167.16
List Price:  RD$5,953.35
You save:  RD$1,786.18
DA9,081.95
List Price:  DA12,974.77
You save:  DA3,892.82
FJ$156.72
List Price:  FJ$223.89
You save:  FJ$67.17
Q539.38
List Price:  Q770.58
You save:  Q231.19
GY$14,672.13
List Price:  GY$20,961.09
You save:  GY$6,288.95
ISK kr8,487.68
List Price:  ISK kr12,125.78
You save:  ISK kr3,638.10
DH634.77
List Price:  DH906.86
You save:  DH272.08
L1,185.27
List Price:  L1,693.32
You save:  L508.04
ден3,677.20
List Price:  ден5,253.37
You save:  ден1,576.16
MOP$565.05
List Price:  MOP$807.25
You save:  MOP$242.20
N$1,240.72
List Price:  N$1,772.53
You save:  N$531.81
C$2,580.75
List Price:  C$3,686.95
You save:  C$1,106.19
रु9,611.84
List Price:  रु13,731.79
You save:  रु4,119.95
S/250.62
List Price:  S/358.05
You save:  S/107.42
K289.08
List Price:  K412.99
You save:  K123.91
SAR262.49
List Price:  SAR375
You save:  SAR112.51
ZK1,653.32
List Price:  ZK2,361.99
You save:  ZK708.66
L303.52
List Price:  L433.61
You save:  L130.09
Kč1,478.68
List Price:  Kč2,112.49
You save:  Kč633.81
Ft23,873.02
List Price:  Ft34,105.78
You save:  Ft10,232.75
SEK kr662.68
List Price:  SEK kr946.73
You save:  SEK kr284.05
ARS$83,184.89
List Price:  ARS$118,840.65
You save:  ARS$35,655.76
Bs484.60
List Price:  Bs692.31
You save:  Bs207.71
COP$284,266.34
List Price:  COP$406,112.18
You save:  COP$121,845.83
₡35,415.85
List Price:  ₡50,596.25
You save:  ₡15,180.39
L1,832.03
List Price:  L2,617.30
You save:  L785.26
₲559,911.94
List Price:  ₲799,908.49
You save:  ₲239,996.54
$U2,820.24
List Price:  $U4,029.08
You save:  $U1,208.84
zł253.29
List Price:  zł361.86
You save:  zł108.56
Already have an account? Log In

Transcript

Hi guys, in this lesson we will talk about GPA. You pull stories in springboard. One of the best advantage of spring bird is auto configuration. And one of them is Java Persistence API repository. You know that in most case, generally, we use typical generation operations on repositories. For example, create operation, update operation, delete operation and select operation.

In simply birth GP repository is used for these kind of generic crude operations. So use it, we just need to extract it on our personal class with entity model and ID field off and the class. After we extend it, we can use many repository operations with GP repository. Automatically, these are find by ID save, delete, find all, delete all save all, etc. Most of cases, these methods will be enough for us. But in some cases, these methods could not be enough for us in GP repository.

We can also describe leave queries or new methods. For example, we have a user entity and this entity has ID, username, password, blah, blah, blah fields. And we want to find user according to username field to do it in GP repository. We don't need extra query. We can do it with find by plus field name methods because GP reports can parse method names to queries like find by Id find by username, find by password, etc. Other things about GP repository, we can create new queries with query annotation.

For example, we want to find maximum ID in user table. To find it, we can write a query like silic max ID from user with clear annotation. Last thing about GP post study, we can customize delete or update operations with methods or queries. methods will be similar like other setting operations, but three years query we should add modify annotation to methods because the operations will need commit execution after queries. Of course, there are other many things in GP repository, but for beginning for our course, this will be enough. That's all.

Thank you.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.