Pro Cloud Native Java EE Apps by 2022
Author:2022
Language: eng
Format: epub
CHAPTER 5
Persistence with Jakarta
EE Persistence
Every application needs to store data at some point during its execution to a durable
data store. The data store could be as simple as a flat file and as complex as a full-fledged database management system. The data store acts as the single source of truth for the
application. For instance, the bank balance of your account with your bank is stored
in some form of data store. This single data is the only source of truth for the bank in identifying how much money they are keeping for you.
Irrespective of the language and platform an application is written in, the process of storing application data into a durable data store generally spans three broad categories, namely, data modelling, data persistence, and data retrieval. In Enterprise Java, the
Jakarta Persistence API is a fully featured specification that allows you to realize these three broad application data persistence categories through the use of annotations and intuitive interfaces.
This chapter is about persisting data to a relational database using the Jakarta
Persistence API or JPA. The goal isnât to teach you everything about JPA, but rather
the essentials of what you need to get very common application data persistence
requirements fulfilled. For a much more comprehensive overview and reference for JPA,
please take a look at the specification1 document. The chapter is split into the three main categories of data modelling, data persistence, and data retrieval.
All the examples in this chapter use the Postgres database as the underlying
database. However, the same principles should apply to all database engines out there as long as you use the JPA constructs. By the end of this chapter, you should be comfortable in using the JPA specification to persist your application data to a relational database.
1 Jakarta Persistence 3.1 Specification
139
© Luqman Saeed and Ghazy Abdallah 2022
L. Saeed and G. Abdallah, Pro Cloud Native Java EE Apps, https://doi.org/10.1007/978-1-4842-8900-6_5
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7402)
Grails in Action by Glen Smith Peter Ledbrook(7295)
Kotlin in Action by Dmitry Jemerov(4637)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4130)
The Age of Surveillance Capitalism by Shoshana Zuboff(3422)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3242)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3027)
Mastering Python for Networking and Security by José Manuel Ortega(2950)
Blockchain Basics by Daniel Drescher(2890)
TCP IP by Todd Lammle(2638)
Microsoft 365 Identity and Services Exam Guide MS-100 by Aaron Guilmette(2602)
From CIA to APT: An Introduction to Cyber Security by Edward G. Amoroso & Matthew E. Amoroso(2483)
Hands-On Azure for Developers by Kamil Mrzyglod(2411)
Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801 by Chris Gill(2358)
React Native - Building Mobile Apps with JavaScript by Novick Vladimir(2339)
MCSA Windows Server 2016 Study Guide: Exam 70-740 by William Panek(2313)
The Social Psychology of Inequality by Unknown(2310)
The Art Of Deception by Kevin Mitnick(2297)
Azure Containers Explained by Wesley Haakman & Richard Hooper(2246)