[hibernate-issues] [Hibernate-JIRA] Created: (BVAL-260) Implement boolean composition of composed constraints

Hardy Ferentschik (JIRA) noreply at atlassian.com
Thu Jan 5 05:54:09 EST 2012


Implement boolean composition of composed constraints
-----------------------------------------------------

                 Key: BVAL-260
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-260
             Project: Bean Validation
          Issue Type: New Feature
          Components: spec-general
    Affects Versions: 1.0 final
            Reporter: Hardy Ferentschik


Should we add boolean composition of constraints as provided by Hibernate Validator (HV-390).
Some examples:
{code}
@ConstraintComposition(OR)
@Pattern(regexp = "K")
@Size(min = 2, max = 10)
@ReportAsSingleViolation
@Target({ METHOD, FIELD })
@Retention(RUNTIME)
@Constraint(validatedBy = { })
public @interface PatternOrSize {
	public abstract String message() default "OR";

	public abstract Class<?>[] groups() default { };

	public abstract Class<? extends Payload>[] payload() default { };
}
{code}

or 

{code}
@ConstraintComposition(ALL_FALSE)
@Target({ METHOD, FIELD, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Constraint(validatedBy = { })
@List({
		@Pattern(regexp = "12345678901"),
		@Pattern(regexp = "98765678765"),
		@Pattern(regexp = "55555555555"),
		@Pattern(regexp = "123456")
})
public @interface Blacklist {
	public abstract String message() default "Blacklisted SSN";

	public abstract Class<?>[] groups() default { };

	public abstract Class<? extends Payload>[] payload() default { };
}
{code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list