Groovy Documentation

## org.codehaus.groovy.grails.orm.hibernate
[Java] Class ConfigurableLocalSessionFactoryBean

    java.lang.Object
      org.springframework.orm.hibernate3.LocalSessionFactoryBean
          org.codehaus.groovy.grails.orm.hibernate.ConfigurableLocalSessionFactoryBean

All Implemented Interfaces:
  ApplicationContextAware

    public class ConfigurableLocalSessionFactoryBean
    extends LocalSessionFactoryBean

A SessionFactory bean that allows the configuration class to be changed and customise for usage within Grails.

Authors:
  Graeme Rocher

Since:
  07-Jul-2005

Method Summary
`void` | `destroy()`
`GrailsApplication` | `getGrailsApplication()` @return Returns the grailsApplication.
`protected Configuration` | `newConfiguration()` Overrides default behaviour to allow for a configurable configuration class.
`protected SessionFactory` | `newSessionFactory(Configuration config)`
`protected void` | `postProcessConfiguration(Configuration config)` Merge HibernateEventListeners with the default ones
`void` | `setApplicationContext(ApplicationContext applicationContext)`
`void` | `setClassLoader(java.lang.ClassLoader classLoader)`
`void` | `setConfigClass(java.lang.Class configClass)` Sets the class to be used for Hibernate Configuration
`void` | `setCurrentSessionContextClass(java.lang.Class currentSessionContextClass)` Sets class to be used for the Hibernate CurrentSessionContext
`void` | `setGrailsApplication(GrailsApplication grailsApplication)` @param grailsApplication The grailsApplication to set.
`void` | `setHibernateEventListeners(HibernateEventListeners listeners)`

Method Detail

### destroy

    @Override
    public void destroy()

### getGrailsApplication

    public GrailsApplication getGrailsApplication()

  Returns:
    Returns the grailsApplication.

### newConfiguration

    @Override
    protected Configuration newConfiguration()

  Overrides default behaviour to allow for a configurable configuration class.

### newSessionFactory

    @Override
    protected SessionFactory newSessionFactory(Configuration config)

### postProcessConfiguration

    @Override
    protected void postProcessConfiguration(Configuration config)

  Merge HibernateEventListeners with the default ones

### setApplicationContext

    public void setApplicationContext(ApplicationContext applicationContext)

### setClassLoader

    public void setClassLoader(java.lang.ClassLoader classLoader)

### setConfigClass

    public void setConfigClass(java.lang.Class configClass)

  Sets the class to be used for Hibernate Configuration
  Parameters:
    `configClass` - A subclass of the Hibernate Configuration class

### setCurrentSessionContextClass

    public void setCurrentSessionContextClass(java.lang.Class currentSessionContextClass)

  Sets class to be used for the Hibernate CurrentSessionContext
  Parameters:
    `currentSessionContextClass` - An implementation of the CurrentSessionContext interface

### setGrailsApplication

    public void setGrailsApplication(GrailsApplication grailsApplication)

  Parameters:
    `grailsApplication` - The grailsApplication to set.

### setHibernateEventListeners

    public void setHibernateEventListeners(HibernateEventListeners listeners)

Groovy Documentation