SessionFactoryImplementor sessionFactory,
SessionFactoryServiceRegistry serviceRegistry) {
// determine requested validation modes.
final Set<ValidationMode> modes = ValidationMode.getModes( configuration.getProperties().get( MODE_PROPERTY ) );
final ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
Dialect dialect = serviceRegistry.getService( JdbcServices.class ).getDialect();
// try to locate a BV class to see if it is available on the classpath
boolean isBeanValidationAvailable;
try {
classLoaderService.classForName( BV_CHECK_CLASS );
isBeanValidationAvailable = true;
}
catch ( Exception e ) {
isBeanValidationAvailable = false;
}