This project is for learning Spring Data JPA and Hibernate
-
In the Spring ecosystem, Spring Data JPA and Hibernate are two popular and powerful technologies that help manage data and interact with databases efficiently.
-
Learning and using these technologies brings many benefits to Java programmers, especially in enterprise application development.
- Simplify your work with databases: Spring Data JPA provides a powerful abstraction layer that makes it easy to perform CRUD (Create, Read, Update, Delete) operations without writing a lot of SQL manually. Hibernate, with its ORM (Object Relational Mapping) capabilities, helps map Java objects to database tables automatically.
- Automating complex operations: With Hibernate and Spring Data JPA, complex query operations can be automated and optimized, thanks to annotations and an object-oriented approach. This saves time and reduces the risk of errors that arise from writing SQL statements manually.
- Highly scalable: Both Hibernate and Spring Data JPA support easy integration with various database management systems, from SQL databases (such as MySQL, PostgreSQL) to NoSQL (such as MongoDB). This makes it easy for your application to scale as requirements change.
- Strong transaction management: Spring Data JPA combined with Spring Transaction Management helps manage data transactions safely and efficiently, ensuring data integrity even in cases of errors.
- Easy integration with other Spring components: Since Spring Data JPA is part of the Spring ecosystem, it integrates very well with other components such as Spring Boot, Spring Security and Spring MVC, making it easy to develop comprehensive applications.
- Git clone this repository: https://github.com/HauHH1910/SpringPersistence.git
- Switch branch for learning Spring Data JPA
- Basic Mappings:
- How to define schema and table names
- How to map basic entity attributes to data columns
- How to map a util Data or Calendar to a database column
- How to map an enum to a database column
- How to map a simple primary key
- How to use an auto-incremented column to generated column to generate primary key values
- How to use a custom database sequence to generate primary key values
- How to use a database table to generate primary keu values
- How to use a generated UUID as a primary key
- How to map a bidirectional many-to-one association
- How to map a unidirectional many-to-one association
- How to map a unidirectional one-to-many association
- How to map a bidirectional many-to-many association
- How to map a unidirectional many-to-many association
- How to map a bidirectional one-to-one association
- How to map a unidirectional one-to-one association
- Advanced Mappings:
- Hibernate Specific Queries and Mappings:
- ...
- Java 8:
- ...
- Logging:
- ...
- JPQL:
- ...
- Native SQL Queries:
- ...
- Create queries programmatically with the Criteria API:
- ...
- Stored Procedures
- ...
- Caching
- ...