Fixed some typos and cleaned up the import list
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@17490 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
9e7e49d1f1
commit
d8342f4a7a
|
@ -1,26 +1,21 @@
|
|||
package org.hibernate.cfg.beanvalidation;
|
||||
|
||||
import java.util.Map;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import java.util.Collection;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.hibernate.util.ReflectHelper;
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.AssertionFailure;
|
||||
import org.hibernate.cfg.Environment;
|
||||
import org.hibernate.mapping.PersistentClass;
|
||||
import org.hibernate.event.EventListeners;
|
||||
import org.hibernate.mapping.PersistentClass;
|
||||
import org.hibernate.util.ReflectHelper;
|
||||
|
||||
/**
|
||||
* This class has no hard depenmdency on Bean Validation APIs
|
||||
* It must uses reflectione very time BV is required.
|
||||
* This class has no hard dependency on Bean Validation APIs
|
||||
* It must use reflection every time BV is required.
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
public class BeanValidationActivator {
|
||||
|
@ -34,7 +29,7 @@ public class BeanValidationActivator {
|
|||
public static void activateBeanValidation(EventListeners eventListeners, Properties properties) {
|
||||
Set<ValidationMode> modes = ValidationMode.getModes( properties.get( MODE_PROPERTY ) );
|
||||
if ( modes.contains( ValidationMode.NONE ) ) return;
|
||||
//desactivate not-null tracking at the core level when Bean Validation is on unless the user really ask for it
|
||||
//de-activate not-null tracking at the core level when Bean Validation is on unless the user really ask for it
|
||||
if ( properties.getProperty( Environment.CHECK_NULLABILITY ) == null ) {
|
||||
properties.setProperty( Environment.CHECK_NULLABILITY, "false" );
|
||||
}
|
||||
|
|
|
@ -1,30 +1,23 @@
|
|||
package org.hibernate.cfg.beanvalidation;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Properties;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import javax.validation.ValidatorFactory;
|
||||
import javax.validation.ConstraintViolation;
|
||||
import javax.validation.ConstraintViolationException;
|
||||
import javax.validation.TraversableResolver;
|
||||
import javax.validation.Validator;
|
||||
import javax.validation.ConstraintViolationException;
|
||||
import javax.validation.groups.Default;
|
||||
import javax.validation.ValidatorFactory;
|
||||
|
||||
import org.hibernate.event.PreInsertEventListener;
|
||||
import org.hibernate.event.PreUpdateEventListener;
|
||||
import org.hibernate.EntityMode;
|
||||
import org.hibernate.engine.SessionFactoryImplementor;
|
||||
import org.hibernate.event.PreDeleteEvent;
|
||||
import org.hibernate.event.PreDeleteEventListener;
|
||||
import org.hibernate.event.PreInsertEvent;
|
||||
import org.hibernate.event.PreInsertEventListener;
|
||||
import org.hibernate.event.PreUpdateEvent;
|
||||
import org.hibernate.event.PreDeleteEvent;
|
||||
import org.hibernate.EntityMode;
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.engine.SessionFactoryImplementor;
|
||||
import org.hibernate.event.PreUpdateEventListener;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
import org.hibernate.util.ReflectHelper;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
|
|
|
@ -225,7 +225,7 @@ class TypeSafeActivator {
|
|||
}
|
||||
|
||||
/**
|
||||
* Retrieve the property by path in a recursive way, including IndetifierProperty in the loop
|
||||
* Retrieve the property by path in a recursive way, including IndentifierProperty in the loop
|
||||
* If propertyName is null or empty, the IdentifierProperty is returned
|
||||
*/
|
||||
private static Property findPropertyByName(PersistentClass associatedClass, String propertyName) {
|
||||
|
@ -290,7 +290,7 @@ class TypeSafeActivator {
|
|||
}
|
||||
catch ( ClassCastException e ) {
|
||||
throw new HibernateException( "Property " + FACTORY_PROPERTY
|
||||
+ " should containt an object of type " + ValidatorFactory.class.getName() );
|
||||
+ " should contain an object of type " + ValidatorFactory.class.getName() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue