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

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(org.springframework.validation.Errors errors, org.springframework.beans.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 GrailsDomainClass getAssociatedDomainClassFromApplication(java.lang.Object associatedObject)

void setSessionFactory(org.hibernate.SessionFactory sessionFactory)

void validate(java.lang.Object obj, org.springframework.validation.Errors errors, boolean cascade)

 
Methods inherited from class GrailsDomainClassValidator
cascadeToAssociativeProperty, cascadeValidationToMany, cascadeValidationToOne, getAssociatedDomainClassFromApplication, getDomainClass, postValidate, setDomainClass, setGrailsApplication, setMessageSource, supports, validate, validate
 
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()
 

Method Detail

cascadeValidationToMany

@Override
protected void cascadeValidationToMany(org.springframework.validation.Errors errors, org.springframework.beans.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()


getAssociatedDomainClassFromApplication

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


setSessionFactory

public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)


validate

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


 

Groovy Documentation