JAva PErsistencia with Spring Data and Hibernate
JPA, NAtive HIbernate, Spring Data JPA
Data persistence is a crucial part of any application, and databases are indisputably at the core of the
modern enterprise.
This demands that the developer be knowledgeable about the application and its data requirements, as
well
as the SQL query language, relational storage structures, and the potential for optimization.
how to retrieve objects efficiently by querying JPA with Querydsl;
how to process and manage transactions with Spring Data and Hibernate;
how to create fetch plans, strategies, and profiles;
how to filter data;
how to configure Hibernate for use in both managed and unmanaged environments;
and how to use their commands.
Thus prepared, in chapter 3 you’ll be ready to learn how to design and implement complex business
domain
models in Java, and which mapping metadata options you have available.
Then chapter 4 will examine working with Spring Data JPA and its features.
Java domain models and in what format you prefer to work with ORM metadata.
1 Understanding object/relational persistence
* Persisting with SQL databases in Java applications
An* alyzing the object/relational paradigm mismatch
In* Introducing ORM, JPA, Hibernate, and Spring Data
Persistence has always been a hot topic of debate in the Java community. Is persistence a problem that
has
already been solved by SQL and extensions such as stored procedures,
1.1.2 Understanding SQL
To use JPA, Hibernate, and Spring Data effectively, you must start with a solid understanding of the
relational model and SQL
When this schema is ready, you can use SQL as a data manipulation language (DML) to perform
operations on
data, including insertions, updates, and deletions. You can retrieve data by executing data query
language
(DQL) statements with restrictions, projections, and Cartesian products.
DDL statements after data has been stored; this is known as schema evolution. You may also use SQL as
a data
control language (DCL) to grant and revoke access to the database or parts of it.
SQL is executed, get a copy of the excellent book SQL Tuning by Dan Tow (Tow, 2003=
Generic data management tools such as ACID-compliant transactional SQL databases, JDBC, Hibernate,
and Spring
Data would play only a minor role for these types of systems.
In this book, we’ll consider the problems of data storage and sharing in the context of an object-
oriented
application that uses a domain model.
Design Patterns: Elements of Reusable Object-Oriented Software [Gamma, 1994])
But for applications with nontrivial business logic, the domain model approach helps to improve code
reuse
and maintainability significantly. In practice, both strategies are common and needed.