This repository contains demos related to Hibernate.
- 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
Demos have been created with the help of JDK 17, Hibernate 6 and MySQL. So ideally your machine should have JDK 17 installed, but they can be executed with other versions of Java as well with a little tweaking. Also ideally your machine should have MySQL Community Server and Workbench installed, but you can use any other relational database as well by changing database connections in code. Also, you should be clear with Java Basics, Collections Framework, Java 8 features and JDBC so that you can understand the flow of code.
Download the demos and import them into your favorite IDE as a Java Project. Ensure that MySQL Server is up and running. If you are a fresher then I recommend to execute demos in same order as provided and if you an expert then you can execute demos as required.
Demos have been explained in an easy way on my YouTube channel Abhishek Verma. Link for the video is Hibernate.