## org.codehaus.groovy.grails.orm.hibernate.cfg
Class GrailsHibernateUtil

    java.lang.Object
      org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsHibernateUtil

    public class GrailsHibernateUtil

extends Object

A class containing utility methods for configuring Hibernate inside Grails

Since:
  0.4

  Created: Jan 19, 2007 Time: 6:21:01 PM
Author:
  Graeme Rocher

Field Summary
`static String` `ARGUMENT_FETCH`
`static String` `ARGUMENT_IGNORE_CASE`
`static String` `ARGUMENT_MAX`
`static String` `ARGUMENT_OFFSET`
`static String` `ARGUMENT_ORDER`
`static String` `ARGUMENT_SORT`
`static SimpleTypeConverter` `converter`
`static String` `ORDER_ASC`
`static String` `ORDER_DESC`

Constructor Summary
`GrailsHibernateUtil()`

Method Summary
`static void` `configureDynamicMethods(ApplicationContext applicationContext, GrailsApplication application)` Configures dynamic methods on all Hibernate mapped domain classes that are found in the application context
`static void` `configureDynamicMethods(org.hibernate.SessionFactory sessionFactory, GrailsApplication application)`
`static DynamicMethods` `configureDynamicMethodsFor(org.hibernate.SessionFactory sessionFactory, GrailsApplication application, Class persistentClass)`
`static void` `configureHibernateDomainClasses(org.hibernate.SessionFactory sessionFactory, GrailsApplication application)`
`static void` `configureInheritanceMappings(Map hibernateDomainClassMap)`
`static org.hibernate.FetchMode` `getFetchMode(Object object)` Will retrieve the fetch mode for the specified instance other wise return the default FetchMode
`static void` `populateArgumentsForCriteria(org.hibernate.Criteria c, Map argMap)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### converter

    public static SimpleTypeConverter converter

### ARGUMENT_MAX

    public static final String ARGUMENT_MAX

See Also:
  Constant Field Values

### ARGUMENT_OFFSET

    public static final String ARGUMENT_OFFSET

See Also:
  Constant Field Values

### ARGUMENT_ORDER

    public static final String ARGUMENT_ORDER

See Also:
  Constant Field Values

### ARGUMENT_SORT

    public static final String ARGUMENT_SORT

See Also:
  Constant Field Values

### ORDER_DESC

    public static final String ORDER_DESC

See Also:
  Constant Field Values

### ORDER_ASC

    public static final String ORDER_ASC

See Also:
  Constant Field Values

### ARGUMENT_FETCH

    public static final String ARGUMENT_FETCH

See Also:
  Constant Field Values

### ARGUMENT_IGNORE_CASE

    public static final String ARGUMENT_IGNORE_CASE

See Also:
  Constant Field Values

Constructor Detail

### GrailsHibernateUtil

    public GrailsHibernateUtil()

Method Detail

### configureDynamicMethods

    public static void configureDynamicMethods(org.hibernate.SessionFactory sessionFactory,
                                               GrailsApplication application)

### configureDynamicMethods

    public static void configureDynamicMethods(ApplicationContext applicationContext,
                                               GrailsApplication application)

  Configures dynamic methods on all Hibernate mapped domain classes that are found in the application context

  Parameters:
    `applicationContext` - The session factory instance
    `application` - The grails application instance

### configureDynamicMethodsFor

    public static DynamicMethods configureDynamicMethodsFor(org.hibernate.SessionFactory sessionFactory,
                                                            GrailsApplication application,
                                                            Class persistentClass)

### configureHibernateDomainClasses

    public static void configureHibernateDomainClasses(org.hibernate.SessionFactory sessionFactory,
                                                       GrailsApplication application)

### configureInheritanceMappings

    public static void configureInheritanceMappings(Map hibernateDomainClassMap)

### populateArgumentsForCriteria

    public static void populateArgumentsForCriteria(org.hibernate.Criteria c,
                                                    Map argMap)

### getFetchMode

    public static org.hibernate.FetchMode getFetchMode(Object object)

  Will retrieve the fetch mode for the specified instance other wise return the default FetchMode

  Parameters:
    `object` - The object, converted to a string
  Returns:
    The FetchMode

Copyright (c) 2005-2006 The Grails project