jpa-with-hibernate: a step-by-step R tutorial repository for JPA and Hibernate
Master JPA using Hibernate as the implementation. Learn the basics of JPA - entities, relationships, entity manager, annotations, JPQL and Criteria API. Take a step into the advanced world of JPA - caching, performance tuning(n + 1 queries), mapping inheritance hierarchies. Get a peek into the magic of Spring Data JPA & Spring Data Rest.
At a glance
- What is it?
- The jpa-with-hibernate repository is the companion code for a 100 step course on JPA with Hibernate and Spring Boot, organised as numbered step directories from a tools introduction through a JDBC to JPA conversion to advanced JPA, with runnable examples, SQL schemas and notes. It suits a Java developer learning persistence layer by layer, and it is a teaching artefact rather than a library to depend on.
- Who is it for?
- jpa-with-hibernate is worth working through if you learn persistence by building it up rather than by reading a specification, because the repository is arranged as a sequence of small, runnable steps and every schema and configuration change is visible in git, so you can see what each layer added. It is the wrong repository to depend on in a project, since it is course material, not a library, and the licence is not classified.
- Can I use it commercially?
- Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
- Is it still maintained?
- Yes. The repository last received commits 31 days ago.
- What is it written in?
- Mainly Java, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.
Editorial analysis
A course repository laid out as numbered steps
The repository is the companion code for a course called Master JPA and Hibernate with Spring Boot in 100 Steps, published on Udemy. The project description states the scope: master JPA using Hibernate as the implementation, learning the basics of JPA, entities, relationships, entity manager, annotations, JPQL and the Criteria API, then caching, performance tuning around n plus 1 queries, and mapping inheritance hierarchies, with a look at Spring Data JPA and Spring Data Rest.
The top-level entries are the course structure. There is 00-framework-tool-introductions/, which is the tools setup, 01-from-jdbc-to-jpa/, which is the conversion of a plain JDBC application to JPA, and 02-jpa-advanced/, which is the advanced material. There are also Step68.md and Step68.zip, and two notes files, notes.md and notes2.md.
That layout is the whole pedagogy. The repository is not a library and not an application, it is a sequence of states of an application, and the directories are chapters. The value for a reader is that each step is small enough to read in full, and the diff between two steps is the concept being taught.
The primary language is Java, the default branch is master, the repository has no GitHub releases, and the last push was on 2026-09-22. The repository is not archived. The licence is not classified, and there is no licence file in the top-level entries, so the terms for reuse of this material are not something the project states plainly and would need to be confirmed with the author.
The JDBC to JPA step is where the model actually changes
The database setup section is where the course does its most concrete work, and it doubles as a configuration reference.
The schema is created by hand in MySQL, with a database, a user and a grant:
mysql --user=user_name --password db_name
create database person_example;
create user 'personuser'@'localhost' identified by 'YOUR_PASSWORD';
grant all on person_example.* to 'personuser'@'localhost';The table itself is plain SQL, and the schema is deliberately minimal so that the mapping is the only new thing in the picture:
create table person
(
id integer not null,
birth_date timestamp,
location varchar(255),
name varchar(255),
primary key (id)
);The data is inserted with three rows using sysdate() for the birth date, and the naming, Ranga, James and Pieter, matches the step-by-step progression of the examples.
The point of the step, and the reason it comes first, is that you see the relational form before the object form. A Person table with an id, a name, a location and a birth date is what the JPA entity is going to be mapped onto, and the advanced section later adds Course, Full_Time_Employee, Part_Time_Employee, Passport, Review, Student and the student_course join table, with the foreign key constraints added by alter table statements. The advanced schema is in the repository as SQL you can read, which is the fastest way to see how the relationship types are represented on the database side before you see them on the Java side.
Switching to MySQL means choosing ddl-auto yourself
Spring Boot's default schema behaviour is one of the more surprising things for a newcomer, and the project documentation spends a paragraph on it because it matters.
The property is spring.jpa.hibernate.ddl-auto, and the documented values are none, validate, update, create, create-only and create-drop. None performs no action, create-only generates database creation, drop generates database dropping, create does dropping followed by creation, validate validates the database schema, and update updates the schema. The setting to perform SchemaManagementTool actions automatically is that property.
The behaviour depends on what Spring Boot thinks your database is. It chooses a default value for you based on whether it thinks your database is embedded, in which case the default is create-drop, or not, in which case the default is none.
So the MySQL path in the project documentation is a deliberate two-part change. You remove the H2 dependency from pom.xml and add the MySQL driver:
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>And you set the properties explicitly:
spring.jpa.hibernate.ddl-auto=none
spring.datasource.url=jdbc:mysql://localhost:3306/person_example
spring.datasource.username=personuser
spring.datasource.password=YOUR_PASSWORDThe ddl-auto=none is the important line, and the project documentation is clear that with none and a hand-created schema, the table and the data are yours to manage. The alternative shown at the end of the section is the opposite posture, with a comment listing the possible values and ddl-auto set to create, which is fine for a scratch database and wrong for anything else.
What the course promises to cover, and where the promises end
The what you will learn list is worth reading as a syllabus, because it also tells you what a reader will not find here.
On the basics, it covers entities, relationships, inheritance mappings and annotations, and it covers three ways of querying data: JPQL, the Criteria API and native queries. The relationship types are covered in depth as one to one, many to one and many to many. It uses a variety of Spring Boot starters, namely Spring Boot Starter Web, Starter Data JPA and Starter Test.
On performance, it covers the two problems every JPA project hits: the n plus 1 query problem and caching, both the first level cache and the second level cache with EhCache. And it covers the basics of Spring Data JPA and Spring Data Rest.
Two things are notably absent from that list. There is nothing on transactions and how the persistence context interacts with them beyond the entity manager, and nothing on testing strategies beyond the use of Starter Test. For a course aimed at getting the fundamentals right before the advanced material, that is a reasonable scope, but a reader looking for guidance on flush versus commit, on optimistic locking, or on how to test persistence code in isolation will not find it here.
The requirements section is candid about the starting point: you should have working knowledge of Java and annotations. The project documentation also says the course helps you install Eclipse and get up and running with Maven and Tomcat, so the tooling is included, but the language is assumed.
Where this repository is the wrong thing to be learning from
The first limit is that it is course material. The repositories are numbered directories of successive states of an example application, the notes files are lecture notes, and the project documentation is a course landing page with links to a Udemy course, a companion course list, and the about section for in28Minutes. Nothing here is packaged, versioned, or supported as a dependency, and treating it as a reference implementation to copy from is a category error, even though the code is good enough to read.
The second limit is the domain. Person, Course, Passport, Student and Review is a teaching schema with one table per concept and no awkwardness in it. There is no multi-column primary key, no enum column, no soft delete that is not a boolean flag, no auditing, no tenant. The advanced section does add inheritance, since there are separate full_time_employee and part_time_employee tables, and it does add a join table for the many-to-many, which is the right kind of complexity to teach in, but it is deliberately the kind that fits on a slide.
The third is the framework coupling. Everything runs inside Spring Boot, and while the course is about JPA and Hibernate, the Spring Boot starters do a lot of the work silently. The auto-configuration of the EntityManager, the property names, the embedded database detection that picks the create-drop default: these are Spring Boot behaviours that a project using JPA without Spring Boot will not have. A reader who then opens a plain JPA project and finds no persistence.xml has been misled by a convenience.
The fourth is the licensing question. The licence is recorded as not classified, and there is no licence file among the top-level entries. For a repository you are only reading and running, that is a low-stakes concern, but for a repository whose examples you might want to copy into a commercial codebase, the terms need to be established with the author first, and the project documentation does not state them.
The fifth is that the version of JPA and Hibernate in the examples is whatever the course was written against, and the project documentation links the Hibernate 5.2 user guide for the ddl-auto reference. The concepts still hold, but the exact property names, defaults and Hibernate behaviour have moved on since.
Editorial conclusion
jpa-with-hibernate is worth working through if you learn persistence by building it up rather than by reading a specification, because the repository is arranged as a sequence of small, runnable steps and every schema and configuration change is visible in git, so you can see what each layer added. It is the wrong repository to depend on in a project, since it is course material, not a library, and the licence is not classified. Before you work through it, check the three things the repository itself tells you: that the examples assume working knowledge of Java and annotations, since the material starts where a beginner course would not; that the default database is an embedded one with a create-drop schema, so the MySQL path in the project documentation is a deliberate switch with ddl-auto set to none and a schema you create by hand; and that the example is a small domain of Person, Course and Passport, so the relationships you will meet are one-to-one, many-to-one and many-to-many in their simplest form rather than the messy cases you will meet in a real schema.
Frequently asked questions
What does the jpa-with-hibernate repository contain?
It is the companion code for a 100 step course on JPA and Hibernate with Spring Boot, arranged as numbered directories: 00-framework-tool-introductions for the tooling setup, 01-from-jdbc-to-jpa for converting a JDBC application, and 02-jpa-advanced for the advanced material, alongside Step68 notes and two notes files.
How do I switch the jpa-with-hibernate examples from H2 to MySQL?
Remove the H2 dependency from pom.xml, add the mysql-connector-j dependency with runtime scope, and set spring.jpa.hibernate.ddl-auto=none together with the datasource url, username and password in application.properties. You then create the database, user, table and rows yourself with the SQL provided in the project documentation.
What does the ddl-auto setting do in the jpa-with-hibernate examples?
It is the setting that performs SchemaManagementTool actions automatically, and the values are none, validate, update, create, create-only and create-drop. Spring Boot picks a default based on whether it thinks the database is embedded, which is create-drop for embedded and none otherwise.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/in28minutes-jpa-with-hibernate)Was this useful?