Chapter 1. Introduction to Hibernate

1.1. Preface

This chapter is an introduction to Hibernate by way of a tutorial, intended for new users of Hibernate. We start with a simple application using an in-memory database. We build the application in small, easy to understand steps. The tutorial is based on another, earlier one developed by Michael Gloegl. All code is contained in the tutorials/web directory of the project source.

Important

This tutorial expects the user have knowledge of both Java and SQL. If you are new or uncomfortable with either, it is advised that you start with a good introduction to that technology prior to attempting to learn Hibernate. It will save time and effort in the long run.

Note

There is another tutorial/example application in the /tutorials/eg directory of the project source. That example is console based and as such would not have the dependency on a servlet container to execute. The basic setup is the same as the instructions below.