## org.codehaus.groovy.grails.orm.hibernate.metaclass
Class AbstractDynamicPersistentMethod

    java.lang.Object
      org.codehaus.groovy.grails.commons.metaclass.AbstractDynamicMethodInvocation
          org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractDynamicPersistentMethod

All Implemented Interfaces:
  DynamicMethodInvocation

Direct Known Subclasses:
  AbstractSavePersistentMethod, ValidatePersistentMethod

    public abstract class AbstractDynamicPersistentMethod

extends AbstractDynamicMethodInvocation

Since:
  Aug 7, 2005
Author:
  Steven Devijver

Constructor Summary
`AbstractDynamicPersistentMethod(Pattern pattern, org.hibernate.SessionFactory sessionFactory, ClassLoader classLoader)`

Method Summary
`protected abstract Object` `doInvokeInternal(Object target, Object[] arguments)`
`protected HibernateTemplate` `getHibernateTemplate()`
`Object` `invoke(Object target, String methodName, Object[] arguments)` Invokes the actual method.
`protected void` `setObjectToReadOnly(Object target)` This method will set the target object to read-only if it is contained with the Hibernate session, Preventing Hibernate dirty-checking from persisting the instance
`protected void` `setObjectToReadWrite(Object target)`

Methods inherited from class org.codehaus.groovy.grails.commons.metaclass.AbstractDynamicMethodInvocation
`getPattern, isMethodMatch, setPattern`

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

Constructor Detail

### AbstractDynamicPersistentMethod

    public AbstractDynamicPersistentMethod(Pattern pattern,
                                           org.hibernate.SessionFactory sessionFactory,
                                           ClassLoader classLoader)

Method Detail

### getHibernateTemplate

    protected HibernateTemplate getHibernateTemplate()

### invoke

    public Object invoke(Object target,
                         String methodName,
                         Object[] arguments)

  Description copied from interface: `DynamicMethodInvocation`

  Invokes the actual method. The target object and arguments are supplied.

  Specified by:
    `invoke` in interface `DynamicMethodInvocation`
  Specified by:
    `invoke` in class `AbstractDynamicMethodInvocation`
  Parameters:
    `target` - the target on which the method is invoked.
    `arguments` - the arguments passed in the method call @return the return value of the dynamic method invocation.

### doInvokeInternal

    protected abstract Object doInvokeInternal(Object target,
                                               Object[] arguments)

### setObjectToReadOnly

    protected void setObjectToReadOnly(Object target)

  This method will set the target object to read-only if it is contained with the Hibernate session, Preventing Hibernate dirty-checking from persisting the instance

  Parameters:
    `target` - The target object

### setObjectToReadWrite

    protected void setObjectToReadWrite(Object target)

Copyright (c) 2005-2009 The Grails project