001package model.validation;
002
003import javax.validation.Constraint;
004import javax.validation.Payload;
005import java.lang.annotation.*;
006
007/**
008 * L'identificativo deve corrispondere a una sezione esistente
009 * @see SectionExistsByIdValidator
010 * @see SectionExistsByNameValidator
011 */
012@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER,
013        ElementType.ANNOTATION_TYPE})
014@Retention(RetentionPolicy.RUNTIME)
015@Constraint(validatedBy = {SectionExistsByNameValidator.class, SectionExistsByIdValidator.class})
016@Documented
017public @interface SectionExists {
018    String message() default "Section must exist";
019
020    Class<?>[] groups() default {};
021
022    Class<? extends Payload>[] payload() default {};
023}