AbstractDynamicPersistentMethod (Grails 2.2.5)
Date: 2014-03-04

Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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, org.hibernate.SessionFactory sessionFactory, java.lang.ClassLoader classLoader, GrailsApplication application)`

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

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

Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Field Detail

### ERRORS_PROPERTY

    public static final java.lang.String ERRORS_PROPERTY

Constructor Detail

### AbstractDynamicPersistentMethod

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

Method Detail

### doInvokeInternal

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

### getHibernateTemplate

    protected org.springframework.orm.hibernate3.HibernateTemplate getHibernateTemplate()

### invoke

    @Override
    public java.lang.Object invoke(java.lang.Object target, java.lang.String methodName, java.lang.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 org.springframework.validation.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