Groovy Documentation

## org.codehaus.groovy.grails.orm.hibernate.validation
[Java] Class HibernateDomainClassValidator

    java.lang.Object
      org.codehaus.groovy.grails.validation.GrailsDomainClassValidator
          org.codehaus.groovy.grails.orm.hibernate.validation.HibernateDomainClassValidator

All Implemented Interfaces:
  ApplicationContextAware

    public class HibernateDomainClassValidator
    extends GrailsDomainClassValidator

First checks if the Hibernate PersistentCollection instance has been initialised before bothering to cascade.

Authors:
  Graeme Rocher

Since:
  0.5

Field Summary

Fields inherited from class GrailsDomainClassValidator
domainClass, grailsApplication, messageSource, targetClass

Method Summary
`protected void` | `cascadeValidationToMany(Errors errors, BeanWrapper bean, GrailsDomainClassProperty persistentProperty, java.lang.String propertyName)` Overrides the default behaviour and first checks if a PersistentCollection instance has been initialised using the wasInitialised() method before cascading
`protected void` | `cascadeValidationToOne(Errors errors, BeanWrapper bean, java.lang.Object associatedObject, GrailsDomainClassProperty persistentProperty, java.lang.String propertyName)`
`protected GrailsDomainClass` | `getAssociatedDomainClassFromApplication(java.lang.Object associatedObject)`
`protected void` | `postValidate(java.lang.Object obj, Errors errors)`
`void` | `setApplicationContext(ApplicationContext applicationContext)`
`void` | `validate(java.lang.Object obj, Errors errors, boolean cascade)`

Methods inherited from class GrailsDomainClassValidator
cascadeToAssociativeProperty, cascadeValidationToMany, cascadeValidationToOne, getAssociatedDomainClassFromApplication, getDomainClass, postValidate, setDomainClass, setGrailsApplication, setMessageSource, supports, validate, validate

Method Detail

### cascadeValidationToMany

    @Override
    protected void cascadeValidationToMany(Errors errors, BeanWrapper bean, GrailsDomainClassProperty persistentProperty, java.lang.String propertyName)

  Overrides the default behaviour and first checks if a PersistentCollection instance has been initialised using the wasInitialised() method before cascading
  Parameters:
    `errors` - The Spring Errors instance
    `bean` - The BeanWrapper for the bean
    `persistentProperty` - The GrailsDomainClassProperty instance
    `propertyName` - The name of the property
  See Also:
    org.hibernate.collection.PersistentCollection#wasInitialized()

### cascadeValidationToOne

    @Override
    protected void cascadeValidationToOne(Errors errors, BeanWrapper bean, java.lang.Object associatedObject, GrailsDomainClassProperty persistentProperty, java.lang.String propertyName)

### getAssociatedDomainClassFromApplication

    @Override
    protected GrailsDomainClass getAssociatedDomainClassFromApplication(java.lang.Object associatedObject)

### postValidate

    @Override
    protected void postValidate(java.lang.Object obj, Errors errors)

### setApplicationContext

    public void setApplicationContext(ApplicationContext applicationContext)

### validate

    @Override
    public void validate(java.lang.Object obj, Errors errors, boolean cascade)

Groovy Documentation