Groovy Documentation

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

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

    public abstract class AbstractDynamicPersistentMethod
    extends AbstractDynamicMethodInvocation

Authors:
  Steven Devijver

Field Summary
`static java.lang.String` | `ERRORS_PROPERTY`

Constructor Summary
`AbstractDynamicPersistentMethod(java.util.regex.Pattern pattern, SessionFactory sessionFactory, java.lang.ClassLoader classLoader)`

Method Summary
`protected java.lang.Object` | `doInvokeInternal(java.lang.Object target, Object[] arguments)`
`protected HibernateTemplate` | `getHibernateTemplate()`
`java.lang.Object` | `invoke(java.lang.Object target, java.lang.String methodName, Object[] arguments)`
`protected void` | `setObjectToReadOnly(java.lang.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(java.lang.Object target)`
`protected Errors` | `setupErrorsProperty(java.lang.Object target)` Initializes the Errors property on target.

Methods inherited from class AbstractDynamicMethodInvocation
getPattern, invoke, isMethodMatch, setPattern

Field Detail

### ERRORS_PROPERTY

    public static final java.lang.String ERRORS_PROPERTY

Constructor Detail

### AbstractDynamicPersistentMethod

    public AbstractDynamicPersistentMethod(java.util.regex.Pattern pattern, SessionFactory sessionFactory, java.lang.ClassLoader classLoader)

Method Detail

### doInvokeInternal

    protected java.lang.Object doInvokeInternal(java.lang.Object target, Object[] arguments)

### getHibernateTemplate

    protected HibernateTemplate getHibernateTemplate()

### invoke

    @Override
    public java.lang.Object invoke(java.lang.Object target, java.lang.String methodName, Object[] arguments)

### setObjectToReadOnly

    protected void setObjectToReadOnly(java.lang.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(java.lang.Object target)

### setupErrorsProperty

    protected Errors setupErrorsProperty(java.lang.Object target)

  Initializes the Errors property on target. The target will be assigned a new Errors property. If the target contains any binding errors, those binding errors will be copied in to the new Errors property. Note that the binding errors will no longer be flagged as binding errors
  Parameters:
    `target` - object to initialize
  Returns:
    the new Errors object

Groovy Documentation