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