Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which pattern does Hibernate follow?

Tags:

In his book "Patterns of Enterprise Application Architecture", Martin Fowler talks about persistence patterns which are commonly found in software development and particularly in relation to ORMs.

Is there a pattern that Hibernate adheres to most closely?

like image 363
yuos Avatar asked Aug 20 '09 18:08

yuos


People also ask

Which design pattern is used in JPA?

The JPA, short for Java Persistence API, is part of the Java EE 5 specification and has been implemented by Hibernate, TopLink, EclipseLink, OpenJPA, and a number of other object-relational mapping (ORM) frameworks.

What type of framework is Hibernate?

Hibernate is an open source object relational mapping (ORM) tool that provides a framework to map object-oriented domain models to relational databases for web applications. Object relational mapping is based on the containerization of objects and the abstraction that provides that capacity.

What is proxy pattern in Hibernate?

How hibernate uses proxy pattern: Hibernate uses proxy pattern to lazy load entities. For lazy loaded entity or collection, hibernate defers database hit till any property other than identifier (Property marked with @Id) is accessed. The proxy object which hibernate creates has only identifier value set.

What is the architecture of Hibernate?

Hibernate has a layered architecture which helps the user to operate without having to know the underlying APIs. Hibernate makes use of the database and configuration data to provide persistence services (and persistent objects) to the application.


1 Answers

Hibernate make use of several patterns:

  • Lazy load (proxing collections)
  • Unit of Work (as part of Session object)
  • probably Identity Map or something more sophisticated
  • Mapping Metadata
  • Query Object for Criterion API
  • all object relational structual patterns
like image 121
dfa Avatar answered Oct 21 '22 07:10

dfa