All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mountain.framework.config.ValidatedConfig Maven / Gradle / Ivy

package com.mountain.framework.config;

import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import org.hibernate.validator.HibernateValidator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ValidatedConfig {
    @Bean
    public Validator validator() {
        ValidatorFactory factory = Validation.byProvider(HibernateValidator.class).configure()
            .failFast(true)
            .buildValidatorFactory();
        return factory.getValidator();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy