A simple console-based application built to practice Jakarta Persistence API (JPA) with Hibernate, using an H2 in-memory database. The system allows full CRUD operations for Authors and Books, demonstrating entity relationships, DAO patterns, transaction control, and basic persistence configuration.
- Create new author
- List all authors
- Find author by ID and display their books
- Update author information
- Delete an author and cascade delete their books
- Create new book
- List all books
- Find a book by ID
- Update book information
- Delete a book
- Java 25
- Jakarta Persistence (JPA 3.0)
- Hibernate
- H2 database
- Maven
- Open your Terminal (or
Git Bashon Windows). - Navigate to the directory (folder) where you want to save the project.
- Clone the repository.
- Import the project into your IDE.
- Run the
Main.main()method.
- Open your browser.
- Go to π http://localhost:8082
(The H2 Console only works while the application is running, because the database is in-memory.)
- Driver Class: org.h2.Driver
- JDBC URL: jdbc:h2:mem:Library
- User: User
- Password: (leave empty)
The main goal of this project was to practice and solidify essential JPA & HIBERNATE concepts by building a full CRUD application. Additionally, the project serves as training in core Java, object-oriented programming, and fundamental database management concepts.