Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

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

All Implemented Interfaces:
  DynamicMethodInvocation

    public class SavePersistentMethod

extends AbstractSavePersistentMethod

Follows the semantics of saveOrUpdate of scheduling the object for persistence when a flush occurs.

Since:
  0.1
Author:
  Steven Devijver, Graeme Rocher

Field Summary
`static Pattern` | `METHOD_PATTERN`
`static String` | `METHOD_SIGNATURE`

Fields inherited from class org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractDynamicPersistentMethod
`ERRORS_PROPERTY`

Constructor Summary
`SavePersistentMethod(org.hibernate.SessionFactory sessionFactory, ClassLoader classLoader, GrailsApplication application)`
`SavePersistentMethod(org.hibernate.SessionFactory sessionFactory, ClassLoader classLoader, GrailsApplication application, GrailsDomainClass domainClass)`

Method Summary
`protected Object` | `performInsert(Object target, boolean shouldFlush)` Subclasses should override and perform an insert operation, flushing the session if the second argument is true
`protected Object` | `performSave(Object target, boolean flush)` Subclasses should override and perform a save operation, flushing the session if the second argument is true

Methods inherited from class org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractSavePersistentMethod
`doInvokeInternal, handleValidationError, isAutoValidationDisabled, setErrorsOnInstance`

Methods inherited from class org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractDynamicPersistentMethod
`getHibernateTemplate, invoke, setObjectToReadOnly, setObjectToReadWrite, setupErrorsProperty`

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`

Field Detail

### METHOD_SIGNATURE

    public static final String METHOD_SIGNATURE

See Also:
  Constant Field Values

### METHOD_PATTERN

    public static final Pattern METHOD_PATTERN

Constructor Detail

### SavePersistentMethod

    public SavePersistentMethod(org.hibernate.SessionFactory sessionFactory,
                                ClassLoader classLoader,
                                GrailsApplication application)

### SavePersistentMethod

    public SavePersistentMethod(org.hibernate.SessionFactory sessionFactory,
                                ClassLoader classLoader,
                                GrailsApplication application,
                                GrailsDomainClass domainClass)

Method Detail

### performSave

    protected Object performSave(Object target,
                                 boolean flush)

  Description copied from class: `AbstractSavePersistentMethod`
  Subclasses should override and perform a save operation, flushing the session if the second argument is true

  Specified by:
    `performSave` in class `AbstractSavePersistentMethod`
  Parameters:
    `target` - The target object to save
    `flush` - Whether to flush
  Returns:
    The target object

### performInsert

    protected Object performInsert(Object target,
                                   boolean shouldFlush)

  Description copied from class: `AbstractSavePersistentMethod`
  Subclasses should override and perform an insert operation, flushing the session if the second argument is true

  Specified by:
    `performInsert` in class `AbstractSavePersistentMethod`
  Parameters:
    `target` - The target object to save
    `shouldFlush` - Whether to flush
  Returns:
    The target object

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD