org.codehaus.groovy.grails.orm.hibernate.validation
Class UniqueConstraint
java.lang.Object
org.codehaus.groovy.grails.validation.AbstractConstraint
org.codehaus.groovy.grails.orm.hibernate.validation.AbstractPersistentConstraint
org.codehaus.groovy.grails.orm.hibernate.validation.UniqueConstraint
- All Implemented Interfaces:
- PersistentConstraint, org.codehaus.groovy.grails.validation.Constraint, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.MessageSourceAware
public class UniqueConstraint
- extends AbstractPersistentConstraint
A constraint that validates the uniqueness of a property (will query the
database during validation process).
- Since:
- 0.4
| Fields inherited from class org.codehaus.groovy.grails.validation.AbstractConstraint |
classShortName, constraintOwningClass, constraintParameter, constraintPropertyName, messageSource |
| Methods inherited from class org.codehaus.groovy.grails.validation.AbstractConstraint |
checkState, getDefaultMessage, getParameter, getPropertyName, rejectValue, rejectValue, rejectValue, rejectValue, rejectValue, rejectValueWithDefaultMessage, setMessageSource, setOwningClass, setPropertyName, skipBlankValues, skipNullValues, toString, validate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.codehaus.groovy.grails.validation.Constraint |
getParameter, getPropertyName, setMessageSource, setOwningClass, setPropertyName, validate |
UNIQUE_CONSTRAINT
public static final java.lang.String UNIQUE_CONSTRAINT
- See Also:
- Constant Field Values
UniqueConstraint
public UniqueConstraint()
isUnique
public boolean isUnique()
- Returns:
- Returns the unique.
isUniqueWithinGroup
public boolean isUniqueWithinGroup()
- Returns:
- Whether the property is unique within a group
setParameter
public void setParameter(java.lang.Object constraintParameter)
- Specified by:
setParameter in interface org.codehaus.groovy.grails.validation.Constraint- Overrides:
setParameter in class org.codehaus.groovy.grails.validation.AbstractConstraint
getName
public java.lang.String getName()
processValidate
protected void processValidate(java.lang.Object target,
java.lang.Object propertyValue,
org.springframework.validation.Errors errors)
- Specified by:
processValidate in class org.codehaus.groovy.grails.validation.AbstractConstraint
getUniquenessGroup
public java.util.List<java.lang.String> getUniquenessGroup()