Design Patterns used in Hibernate Framework

In this post, let's discuss a different kind of design patterns which are widely used in the Hibernate Framework. Design Patterns denote the best computer programming practices in object-oriented software development. Hibernate framework has been built by using the following design pattern or standard practices.
I listed few known design patterns used in Hibernate Framework.
Please leave a comment, if you know any other design patterns used in Hibernate Framework.

You can also read my post of Design Patterns used in Spring Framework.

Domain Model Pattern

The domain model is treated as POJO in Hibernate.

The domain model is an object model of the domain that incorporates both behavior and data.

Read more about Domain Model Pattern here at

Proxy Design Pattern

Proxy Pattern for lazy loading -

Proxy Pattern provides a surrogate or placeholder for another object to control access to it.

Read more about Proxy Design Pattern here at

Factory Design Pattern

SessionFactory of Hibernate is an example of the Factory Design Pattern.

This pattern defines an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.

Read more about Proxy Design Pattern here at

Query Object Pattern

Hibernate Criteria API and the modern JPA2 Criteria API are an excellent examples Query Object Pattern.

Read more about Query Object Pattern here at

Data Mapper Pattern

A layer of Mappers that moves data between objects and a database while keeping them independent of each other and the mapper itself.

Read more about Data Mapper Pattern here at

Unit of Work

This pattern as part of Session object in hibernate.

Read more about Unit of Work here at