Author: epbernard
Date: 2006-10-27 17:35:48 -0400 (Fri, 27 Oct 2006)
New Revision: 10657
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/PropertyBinder.java
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/Version.java
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/reflection/java/JavaXProperty.java
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/validator/event/ValidateEventListener.java
Log:
ANN-456 use the same reflectionManager in ValidateEventListener
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/PropertyBinder.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/PropertyBinder.java 2006-10-27
20:03:29 UTC (rev 10656)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/PropertyBinder.java 2006-10-27
21:35:48 UTC (rev 10657)
@@ -152,7 +152,7 @@
prop.setGeneration( PropertyGeneration.parse( generated.toString().toLowerCase() )
);
}
}
- log.debug( "Cascading " + name + " with " + cascade );
+ log.trace( "Cascading " + name + " with " + cascade );
return prop;
}
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/Version.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/Version.java 2006-10-27
20:03:29 UTC (rev 10656)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/Version.java 2006-10-27
21:35:48 UTC (rev 10657)
@@ -8,7 +8,7 @@
* @author Emmanuel Bernard
*/
public class Version {
- public static final String VERSION = "3.2.0.GA";
+ public static final String VERSION = "3.2.1-dev";
private static Log log = LogFactory.getLog( Version.class );
static {
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/reflection/java/JavaXProperty.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/reflection/java/JavaXProperty.java 2006-10-27
20:03:29 UTC (rev 10656)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/reflection/java/JavaXProperty.java 2006-10-27
21:35:48 UTC (rev 10657)
@@ -19,10 +19,10 @@
class JavaXProperty extends JavaXMember implements XProperty {
static boolean isProperty(Field f, Type boundType, Filter filter) {
- return isPropertyType( boundType )
- && !f.isSynthetic()
- && ( filter.returnStatic() || ! Modifier.isStatic( f.getModifiers() ) )
- && ( filter.returnTransient() || ! Modifier.isTransient( f.getModifiers() )
);
+ return ( filter.returnStatic() || ! Modifier.isStatic( f.getModifiers() ) )
+ && ( filter.returnTransient() || ! Modifier.isTransient( f.getModifiers() )
)
+ && !f.isSynthetic()
+ && isPropertyType( boundType );
}
private static boolean isPropertyType(Type type) {
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/validator/event/ValidateEventListener.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/validator/event/ValidateEventListener.java 2006-10-27
20:03:29 UTC (rev 10656)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/validator/event/ValidateEventListener.java 2006-10-27
21:35:48 UTC (rev 10657)
@@ -12,9 +12,12 @@
import org.hibernate.AssertionFailure;
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
+import org.hibernate.reflection.ReflectionManager;
+import org.hibernate.reflection.java.JavaXFactory;
import org.hibernate.util.StringHelper;
import org.hibernate.util.ReflectHelper;
import org.hibernate.cfg.Configuration;
+import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.event.Initializable;
import org.hibernate.event.PreInsertEvent;
import org.hibernate.event.PreInsertEventListener;
@@ -69,10 +72,18 @@
}
}
Iterator<PersistentClass> classes = (Iterator<PersistentClass>)
cfg.getClassMappings();
- while ( classes.hasNext() ) {
+ ReflectionManager reflectionManager;
+ if ( cfg instanceof AnnotationConfiguration ) {
+ //reuse the existing reflectionManager one when possible
+ reflectionManager = ( (AnnotationConfiguration)
cfg).getReflectionManager();
+ }
+ else {
+ reflectionManager = new JavaXFactory();
+ }
+ while ( classes.hasNext() ) {
PersistentClass clazz = classes.next();
final Class mappedClass = clazz.getMappedClass();
- ClassValidator validator = new ClassValidator( mappedClass, interpolator );
+ ClassValidator validator = new ClassValidator( mappedClass, null, interpolator, null,
reflectionManager );
ValidatableElement element = new ValidatableElement( mappedClass, validator );
addSubElement( clazz.getIdentifierProperty(), element );
Iterator properties = clazz.getPropertyIterator();
Show replies by date