Search in sources :

Example 1 with ParanamerParameterNameProvider

use of org.hibernate.validator.parameternameprovider.ParanamerParameterNameProvider in project adeptj-modules by AdeptJ.

the class HibernateValidatorService method start.

// --------------------------- INTERNAL ---------------------------
// ---------------- Component lifecycle methods -------------------
@Activate
protected void start() {
    try {
        final long startTime = System.nanoTime();
        this.validatorFactory = Validation.byProvider(HibernateValidator.class).configure().parameterNameProvider(new ParanamerParameterNameProvider()).buildValidatorFactory();
        LOGGER.info("HibernateValidator initialized in [{}] ms!!", NANOSECONDS.toMillis(System.nanoTime() - startTime));
    } catch (NoProviderFoundException ex) {
        LOGGER.error("Could not create ValidatorFactory!!", ex);
        throw ex;
    }
}
Also used : NoProviderFoundException(javax.validation.NoProviderFoundException) ParanamerParameterNameProvider(org.hibernate.validator.parameternameprovider.ParanamerParameterNameProvider) Activate(org.osgi.service.component.annotations.Activate)

Aggregations

NoProviderFoundException (javax.validation.NoProviderFoundException)1 ParanamerParameterNameProvider (org.hibernate.validator.parameternameprovider.ParanamerParameterNameProvider)1 Activate (org.osgi.service.component.annotations.Activate)1