Database and Hibernate

Hibernate has almost become default standard for mapping objects to relational database. Hibernate does an extremely good job at abstraction of object relational mapping. Most good abstractions create problem if their inner workings are not well understood. This tutorial would provide an opportunity to learn some of these. It also provide insights into database transactions and few other database concepts. This tutorial doesn't intend to be a reference, instead focuses on important things which typically go wrong.

The structure of the material is intended to help in

  • Understanding the concepts via working code and examples
  • creating a working environment in which other related concepts can be learnt by trying out code

Where is the source code?

http://github.com/petmongrels/learn-hibernate

What do I need to have?

Java, SQL Server 2005 and Oracle10g. A good Java IDE is recommended. Even if you have just one database you would be able to try out common and that database specific examples.

Setup and configuration

Database

Transaction atomicity

Transaction isolation

Optimistic Offline lock

SQL injection

Use database invariants

Hibernate

Persisting objects

Versioning (Offline lock)

Lazy loading

Second level cache