Welcome to the Hibernate repository! This repository provides hands-on demos covering everything from basic CRUD operations to advanced concepts like mappings, HQL, transaction management, and caching helping you build efficient and scalable database applications.
- CRUD operations using JDBC
- Configuring Hibernate
- CRUD operations using Hibernate
- Primary Key using AUTO strategy
- Primary Key using IDENTITY strategy
- Primary Key using UUID strategy
- Composite Primary Key
- Natural Id
- One-to-One Mapping
- One-to-One Bidirectional Mapping
- Eager Loading vs Lazy Loading
- One-to-Many Mapping and Many-to-One Mapping
- Many-to-Many Mapping
- Single Table Inheritance
- Joined Inheritance
- Table Per Class Inheritance
- MappedSuperClass
- Introduction to HQL
- Solution to N+1 Problem
- Complex Queries with HQL
- Hibernate Criteria API
- Hibernate Entity Lifecycle
- Primary Cache
- Secondary Cache
- Configuring JPA
- CRUD operations using JPA
These demos have been built using JDK 17, Hibernate 6. While it is recommended to have JDK 17 installed, the examples can be adapted to other Java versions with minimal modifications.
The database used in these examples is MySQL, but the code can be adjusted to work with other databases if needed.
Before diving into Hibernate, ensure you're comfortable with the following concepts:
You can learn these topics from my YouTube channel through dedicated playlists.Follow these steps to set up and execute the demos:
- Clone the repository.
- Import the project into your preferred IDE as a Maven Project.
- Configure the database connection, if necessary.
- Run the application and test the methods.
If you're a beginner, it's best to execute the demos in the given order to build your understanding progressively. If you're experienced, feel free to explore specific demos based on your needs.
These demos are explained in detail on my YouTube channel Abhishek Verma. Watch the complete playlist here: Hibernate.
🚀 Stay healthy, keep learning, and keep growing!