
Explore the basics of orm, mapping Java objects to database tables to simplify sql, and see how JPA stores, updates, and retrieves data in Spring Boot rest APIs.
JPA boosts developer productivity by simplifying configuration and reducing SQL boilerplate. It provides database independence, automatic type handling, and first- and second-level caching to improve performance.
Explore how to define relationships between entities in JPA using four annotations: one to one, one to many, many to one, and many to many.
Explore inheritance strategies in JPA and Hibernate, learn how four mapping approaches store inherited fields across tables, and choose the best strategy for entities like books and blog posts.
Discover the single table strategy for JPA inheritance, mapping all hierarchy entities to one table, simplifying schema, avoiding joins, and boosting performance with shared publication fields.
Explore joining multiple entities in JPA by fetching authors and their books via a common foreign key. Learn about theta joins for unrelated entities and why JPA restricts them.
Explore JPQL functions used in select and where clauses, mirroring SQL, and apply examples like upper, lower, current date, substring, trim, length, locate, abs, sqrt, mod, and size.
Explore grouping in JPQL using group by and the having clause, counting by last name, listing non-aggregated attributes, and filtering groups such as last names starting with B.
call named queries at runtime using typed query and query interfaces, instantiated via different entity manager factory methods, to return typed results or raw results.
See how Hibernate uses a version field to detect conflicting updates in a product entity, and how a higher database version triggers an optimistic lock exception.
Enable pessimistic locking with a transactional method in Spring Data JPA by reading, updating, and saving a product entity, with the transactional annotation controlling the lock until commit or rollback.
Learn to optimize performance with pagination in Spring Data JPA by lazy loading data in pages, using a fixed page size and page number.
Prevent the N+1 select problem by using join fetch to retrieve related data in a single query. Replace iterative per-item queries with a join fetch to boost database performance.
optimize queries by balancing join usage and using criteria builder API for dynamic queries; rely on JPA repository methods like find by, delete in batch, and flush after saves.
Engage in hands-on practicum with JPA and Spring Data JPA, building Maven projects, using bare JPA with EntityManager and Java 17, and another with Spring Boot and Spring Data JPA.
Explore future trends in Java enterprise development with Spring Data JPA, including repositories, query DSL, auditing, pagination, and multi-database support from relational databases to Neo4j and MongoDB.
Set up your development environment by installing JDK 17 for Windows 64 via MSI and selecting an IDE such as IntelliJ, Eclipse, or NetBeans, then configure Maven in your classpath.
Configure the persistence unit in META-INF/Persistence.xml using Hibernate to connect to an in-memory H2 database or MySQL, setting dialect, show_sql, and hbm2ddl.auto options with resource local transactions.
Set up a Twitter repository using an entity manager and factory for a persistence unit, and implement add, find, search, update, and delete operations within transactions.
Set up the teacher repository with an entity manager and factory, define constructors, and perform add, find by id, update, and delete operations within a resource-local persistence unit transaction.
Explore how pom.xml dependencies configure spring data jpa projects and how application.properties and profile-specific files control local, dev, test, and production settings, including H2 and MySQL databases.
Update property flow through the property controller and service using patch or put to find and update a property, save it, and illustrate Spring Data JPA crud operations.
Learn to write find by queries in Spring Data JPA using an enterprise project with role and address entities, including enum name searches via repository.
In this course you will learn about JPA, ORM different concepts about them. Then you will learn about how to use different concepts in real world project. Later you will learn about Entity, Entity Manager, Query, Criteria, Persistence Context, Persistence Unit, Transaction, Lazy loading, Relationships, SpringData JPA. Finally you will learn to use JPA without Springboot and JPA with Springboot by doing two real world projects.
You will about real world uses of SpringData JPA findBy, countBy, existsBy, deleteBy queries.
Following is the list of topics that you will learn in this course:
Introduction to JPA
Overview of Java Persistence API (JPA) Evolution from JPA 1 to JPA 2 Key features and benefits
Entity Basics
Creating JPA entities Entity lifecycle and states Annotations (@Entity, @Id, @GeneratedValue, etc.) Embeddable and embedded objects
Mapping Entities
Mapping entity attributes One-to-One, One-to-Many, and Many-to-One relationships Many-to-Many relationships Mapping inheritance hierarchies (Single Table, Joined, and Table per Class strategies)
JPQL (Java Persistence Query Language)
Overview of JPQL Querying entities with JPQL Named queries JPQL functions and aggregation
Criteria API
Introduction to Criteria API Building type-safe queries Predicate, CriteriaQuery, and CriteriaBuilder
Transactions and Persistence Context
Managing transactions in JPA Entity Manager and Persistence Context Transaction demarcation (declarative and programmatic)
Advanced Mapping Techniques
Embedded objects and collections Lazy and eager loading strategies Optimistic and pessimistic locking Custom converters and mappings
Performance Tuning and Best Practices
Fetch strategies and batching Caching strategies (1st and 2nd level cache) Query optimization Best practices for efficient data access
Integration with Java EE and Spring
Using JPA in Java EE applications Spring Data JPA integration Transaction management with JTA and Spring
Testing and Debugging JPA Applications
Unit testing JPA entities and queries Debugging common JPA issues Integration testing with embedded databases
Migration and Upgrading
Migrating from JPA 1 to JPA 2 Upgrading JPA providers Handling version-specific issues
Future of JPA
Trends and advancements in ORM frameworks JPA vs. other ORM solutions Considerations for modern application development.
After this course you will become pro level developer who will be very confident to work in any project which uses JPA or SpringData JPA.