Groovy Documentation

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

java.lang.Object
  org.codehaus.groovy.grails.validation.AbstractConstraint
      org.codehaus.groovy.grails.orm.hibernate.validation.AbstractPersistentConstraint
All Implemented Interfaces:
PersistentConstraint

public abstract class AbstractPersistentConstraint
extends AbstractConstraint

Constraints that require access to the HibernateTemplate should subclass this class.

Authors:
Graeme Rocher
Since:
0.4


Field Summary
protected org.springframework.context.ApplicationContext applicationContext

static java.lang.ThreadLocal sessionFactory

 
Fields inherited from class AbstractConstraint
classShortName, constraintOwningClass, constraintParameter, constraintPropertyName, messageSource
 
Method Summary
org.springframework.orm.hibernate3.HibernateTemplate getHibernateTemplate()

boolean isValid()

Return whether the constraint is valid for the owning class

void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)

boolean supports(java.lang.Class type)

Returns whether the constraint supports being applied against the specified type;

 
Methods inherited from class AbstractConstraint
checkState, getDefaultMessage, getParameter, getPropertyName, isValid, processValidate, rejectValue, rejectValue, rejectValue, rejectValue, rejectValue, rejectValueWithDefaultMessage, setMessageSource, setOwningClass, setParameter, setPropertyName, skipBlankValues, skipNullValues, toString, 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()
 

Field Detail

applicationContext

protected org.springframework.context.ApplicationContext applicationContext


sessionFactory

public static java.lang.ThreadLocal sessionFactory


 
Method Detail

getHibernateTemplate

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


isValid

@Override
public boolean isValid()
Return whether the constraint is valid for the owning class
Returns:
true if it is


setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)


supports

public boolean supports(@SuppressWarnings("rawtypes") java.lang.Class type)
Returns whether the constraint supports being applied against the specified type;
Parameters:
type - The type to support
Returns:
true if the constraint can be applied against the specified type


 

Groovy Documentation