# hibernate

## Purpose

The `hibernate` plug-in sets up GORM and Grails' Hibernate integration.

## Examples

An example domain class:

    class Book {
    	String title
    	Date releaseDate
    	Author author
    }

## Description

Refer to the section on GORM in the Grails user guide which details how to create Grails domain classes.

Configured Spring Beans:

- `dialectDetector` - An instance of org.codehaus.groovy.grails.orm.hibernate.support.HibernateDialectDetectorFactoryBean that attempts to automatically detect the Hibernate Dialect which is used to communicate with the database.
- `hibernateProperties` - A map of Hibernate properties passed to the `SessionFactory`
- `lobHandlerDetector` - An instance of org.codehaus.groovy.grails.orm.hibernate.support.SpringLobHandlerDetectorFactoryBean that attempts to automatically detect the Spring LobHandler to use based on the database.
- `sessionFactory` - An instance of the Hibernate SessionFactory class used by the GORM infrastructure.
- `transactionManager` - An instance of Spring's org.springframework.orm.hibernate3.HibernateTransactionManager class
- `persistenceInterceptor` - An instance of org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor that abstracts away how persistence is used from the controller/view layer so that Grails can be used without GORM.
- `openSessionInViewInterceptor` - An instance of org.codehaus.groovy.grails.orm.hibernate.support.GrailsOpenSessionInViewFilter that deals with Grails' Session management.