|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
public abstract class AbstractSavePersistentMethod extends AbstractDynamicPersistentMethod
Abstract class for different implementations that perform saving to implement.
Field Summary |
---|
Fields inherited from class AbstractDynamicPersistentMethod | |
---|---|
ERRORS_PROPERTY |
Constructor Summary | |
AbstractSavePersistentMethod(java.util.regex.Pattern pattern, org.hibernate.SessionFactory sessionFactory, java.lang.ClassLoader classLoader, GrailsApplication application, GrailsDomainClass domainClass, HibernateDatastore datastore)
|
|
AbstractSavePersistentMethod(java.util.regex.Pattern pattern, org.hibernate.SessionFactory sessionFactory, java.lang.ClassLoader classLoader, GrailsApplication application, HibernateDatastore datastore)
|
Method Summary | |
---|---|
static void
|
clearDisabledValidations(java.lang.Object obj)
|
static void
|
clearDisabledValidations()
|
protected java.lang.Object
|
doInvokeInternal(java.lang.Object target, java.lang.Object[] arguments)
|
protected java.lang.Object
|
handleValidationError(GrailsDomainClass domainClass, java.lang.Object target, org.springframework.validation.Errors errors)
Sets the flush mode to manual. which ensures that the database changes are not persisted to the database if a validation error occurs. |
static boolean
|
isAutoValidationDisabled(java.lang.Object obj)
|
protected java.lang.Object
|
performInsert(java.lang.Object target, boolean shouldFlush)
|
protected java.lang.Object
|
performSave(java.lang.Object target, boolean shouldFlush)
Subclasses should override and perform a save operation, flushing the session if the second argument is true |
protected void
|
setErrorsOnInstance(java.lang.Object target, org.springframework.validation.Errors errors)
Associates the Errors object on the instance |
Methods inherited from class AbstractDynamicPersistentMethod | |
---|---|
doInvokeInternal, getHibernateTemplate, invoke, setObjectToReadOnly, setObjectToReadWrite, setupErrorsProperty |
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), java.lang.Object#wait(long, int), 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() |
Constructor Detail |
---|
public AbstractSavePersistentMethod(java.util.regex.Pattern pattern, org.hibernate.SessionFactory sessionFactory, java.lang.ClassLoader classLoader, GrailsApplication application, @SuppressWarnings("unused") GrailsDomainClass domainClass, HibernateDatastore datastore)
public AbstractSavePersistentMethod(java.util.regex.Pattern pattern, org.hibernate.SessionFactory sessionFactory, java.lang.ClassLoader classLoader, GrailsApplication application, HibernateDatastore datastore)
Method Detail |
---|
public static void clearDisabledValidations(java.lang.Object obj)
public static void clearDisabledValidations()
@SuppressWarnings("rawtypes") @Override protected java.lang.Object doInvokeInternal(java.lang.Object target, java.lang.Object[] arguments)
protected java.lang.Object handleValidationError(GrailsDomainClass domainClass, java.lang.Object target, org.springframework.validation.Errors errors)
domainClass
- The domain classtarget
- The target object that failed validationerrors
- The Errors instance
public static boolean isAutoValidationDisabled(java.lang.Object obj)
protected java.lang.Object performInsert(java.lang.Object target, boolean shouldFlush)
protected java.lang.Object performSave(java.lang.Object target, boolean shouldFlush)
target
- The target object to saveshouldFlush
- Whether to flush
protected void setErrorsOnInstance(java.lang.Object target, org.springframework.validation.Errors errors)
target
- The target instanceerrors
- The Errors object
Groovy Documentation