org.codehaus.groovy.grails.orm.hibernate.metaclass
Class AbstractStaticPersistentMethod

java.lang.Object
  extended by org.codehaus.groovy.grails.commons.metaclass.AbstractStaticMethodInvocation
      extended by org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractStaticPersistentMethod
All Implemented Interfaces:
StaticMethodInvocation
Direct Known Subclasses:
AbstractClausedStaticPersistentMethod, CountPersistentMethod, CreateCriteriaPersistentMethod, ExecuteQueryPersistentMethod, ExecuteUpdatePersistentMethod, ExistsPersistentMethod, FindAllPersistentMethod, FindAllWherePersistentMethod, FindPersistentMethod, FindWherePersistentMethod, GetAllPersistentMethod, GetPersistentMethod, ListOrderByPersistentMethod, ListPersistentMethod, WithCriteriaDynamicPersistentMethod, WithTransactionPersistentMethod

public abstract class AbstractStaticPersistentMethod
extends AbstractStaticMethodInvocation

Abstract base class for static persistent methods

Since:
Aug 8, 2005
Author:
Steven Devijver, Graeme Rocher

Field Summary
protected static String ARGUMENT_FETCH
           
protected static String ARGUMENT_MAX
           
protected static String ARGUMENT_OFFSET
           
protected static String ARGUMENT_ORDER
           
protected static String ARGUMENT_SORT
           
protected static String ORDER_ASC
           
protected static String ORDER_DESC
           
 
Constructor Summary
AbstractStaticPersistentMethod(org.hibernate.SessionFactory sessionFactory, ClassLoader classLoader, Pattern pattern)
           
 
Method Summary
protected abstract  Object doInvokeInternal(Class clazz, String methodName, Object[] arguments)
           
protected  org.hibernate.FetchMode getFetchMode(Object object)
          Will retrieve the fetch mode for the specified instance other wise return the default FetchMode
protected  HibernateTemplate getHibernateTemplate()
           
 Object invoke(Class clazz, String methodName, Object[] arguments)
          Invokes the actual method.
protected  void populateArgumentsForCriteria(org.hibernate.Criteria c, Map argMap)
           
 
Methods inherited from class org.codehaus.groovy.grails.commons.metaclass.AbstractStaticMethodInvocation
getPattern, isMethodMatch, setPattern, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ARGUMENT_MAX

protected static final String ARGUMENT_MAX
See Also:
Constant Field Values

ARGUMENT_OFFSET

protected static final String ARGUMENT_OFFSET
See Also:
Constant Field Values

ARGUMENT_ORDER

protected static final String ARGUMENT_ORDER
See Also:
Constant Field Values

ARGUMENT_SORT

protected static final String ARGUMENT_SORT
See Also:
Constant Field Values

ORDER_DESC

protected static final String ORDER_DESC
See Also:
Constant Field Values

ORDER_ASC

protected static final String ORDER_ASC
See Also:
Constant Field Values

ARGUMENT_FETCH

protected static final String ARGUMENT_FETCH
See Also:
Constant Field Values
Constructor Detail

AbstractStaticPersistentMethod

public AbstractStaticPersistentMethod(org.hibernate.SessionFactory sessionFactory,
                                      ClassLoader classLoader,
                                      Pattern pattern)
Method Detail

getHibernateTemplate

protected HibernateTemplate getHibernateTemplate()

invoke

public Object invoke(Class clazz,
                     String methodName,
                     Object[] arguments)
Description copied from interface: StaticMethodInvocation

Invokes the actual method. The class, method name and arguments are provided. If no arguments are passed the argument array is empty.

Specified by:
invoke in interface StaticMethodInvocation
Specified by:
invoke in class AbstractStaticMethodInvocation
Parameters:
clazz - the class the static method is called on
methodName - the static method name
arguments - the arguments supplied
Returns:
the return value of the static method invocation

doInvokeInternal

protected abstract Object doInvokeInternal(Class clazz,
                                           String methodName,
                                           Object[] arguments)

populateArgumentsForCriteria

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

getFetchMode

protected 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