Single logo
  • Courses
  • Blog
  • About
Join on SkoolJoin on Skool
  1. Blog
  2. /
  3. Hibernate

Topic

Hibernate

Hibernate ORM: entities, sessions, mappings and queries.

11 posts·3 sections

Start here

Start with: SQLite and a JDBC Connection Pool in a Java Web App
Sections
Fundamentals6Mappings3Queries2
Section 16 posts

Fundamentals

  1. 01
    SQLite and a JDBC Connection Pool in a Java Web App

    A whole database in one file, studyeasy.db, and a Java web app that talks to it: one HikariCP pool, a @WebListener that opens it and runs schema.sql at startup, and a /db-check servlet that borrows a connection.

  2. 02
    Why an ORM: The Same UserDao in JDBC and in Hibernate

    One UserDao, written twice. The JDBC version spells out every SQL string and copies every column; the Hibernate version persists, finds and merges objects and lets Hibernate write the SQL. 66 lines against 40, and what that costs.

  3. 03
    Hibernate 7 Setup: Three Dependencies, hibernate.cfg.xml and a First Session

    Four pieces, one job each: three Maven dependencies, a two-property hibernate.cfg.xml, one SessionFactory per app and one Session per piece of work. A small main method proves it: Rows in users: 3.

  4. 04
    Hibernate Entity Classes and CRUD With the Session: persist, find, a Setter and remove

    Four small programs against a three-row users table: persist adds Noah and the id comes back as 4, find reads Emma (twice, with one SELECT), a setter changes Liam's email, and remove deletes Noah. Every change goes out at commit.

  5. 05
    Hibernate Inside a Servlet Web App: Replace the JDBC DAO, Keep Every Page

    The Users web app's UserDao, rewritten with Hibernate: same five methods, no SQL strings, one SessionFactory built on the existing HikariCP pool, and zero of the eight servlets and JSPs changed.

  6. 06
    Spring MVC and SQLite Without Spring Boot: the Mini Blog in the Browser

    Five small classes put the Mini Blog in the browser: BlogServer starts Tomcat with a DispatcherServlet, BlogConfig turns on MVC and builds a SessionFactory for blog.db, PostController answers /posts and PostRepository reads with Hibernate. Run it with docker compose.

Section 23 posts

Mappings

  1. 07
    Hibernate Entity Classes and CRUD With the Session: persist, find, a Setter and remove

    Four small programs against a three-row users table: persist adds Noah and the id comes back as 4, find reads Emma (twice, with one SELECT), a setter changes Liam's email, and remove deletes Noah. Every change goes out at commit.

  2. 08
    Entities and H2 in Spring Boot: a Post Class Becomes a Table

    The blog's cards are typed into HTML. A Post class with @Entity and @Id becomes the POST table in an in-memory H2 database: three pom lines, a few YAML settings, and Hibernate writes the create table SQL at startup.

  3. 09
    JPA Entity Mapping: Ids, Enums and Dates, From a Java Class to a Table

    A Book class becomes a book table: every annotation and the column it produces, IDENTITY versus SEQUENCE ids, the ORDINAL enum trap that turns The Hobbit into a mystery, and LocalDate versus Instant.

Section 32 posts

Queries

  1. 10
    HQL in Hibernate 7: List, Where With a Named Parameter, Bulk Update and Bulk Delete

    HQL talks about classes, not tables. List every User, find Olivia with :email, move two users to a new email domain in one bulk update, then delete everyone after id 1, with the SQL Hibernate printed for each.

  2. 11
    The N+1 Problem in JPA: Fetch Types, Join Fetch and Entity Graphs

    Relay's ticket list of 50 tickets quietly sends 51 queries. Count them with Hibernate statistics, bring it down to 1 with a left join fetch or an entity graph, and see why EAGER still sends 51.

Sections
  1. 1.Fundamentals6
  2. 2.Mappings3
  3. 3.Queries2
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Single logo

Empowering Education, One Course at a Time

About
About usContact us
Legal
Terms of UsePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.