Author: epbernard
Date: 2007-01-26 16:17:27 -0500 (Fri, 26 Jan 2007)
New Revision: 11107
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/validator/event/ValidateEventListener.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/NonHibernateAnnotationsIntegrationTest.java
Log:
ANN-545 eliminate dep between HAN and Validator
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 2007-01-26
20:55:59 UTC (rev 11106)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/validator/event/ValidateEventListener.java 2007-01-26
21:17:27 UTC (rev 11107)
@@ -73,11 +73,13 @@
}
Iterator<PersistentClass> classes = (Iterator<PersistentClass>)
cfg.getClassMappings();
ReflectionManager reflectionManager;
- if ( cfg instanceof AnnotationConfiguration ) {
+ try {
+ //TODO introduce q ReflectionManagerHolder interface to avoid reflection
+ //I want to avoid hard link between HAN and Validator for usch a simple
need
//reuse the existing reflectionManager one when possible
- reflectionManager = ( (AnnotationConfiguration)
cfg).getReflectionManager();
- }
- else {
+ reflectionManager = (ReflectionManager) cfg.getClass().getMethod(
"getReflectionManager" ).invoke(cfg);
+
+ } catch (Exception e) {
reflectionManager = new JavaReflectionManager();
}
while ( classes.hasNext() ) {
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/NonHibernateAnnotationsIntegrationTest.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/NonHibernateAnnotationsIntegrationTest.java 2007-01-26
20:55:59 UTC (rev 11106)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/NonHibernateAnnotationsIntegrationTest.java 2007-01-26
21:17:27 UTC (rev 11107)
@@ -12,8 +12,7 @@
import org.hibernate.validator.event.ValidatePreUpdateEventListener;
/**
- * Test the validate framework integration with the Hibernate
- * metadata binding
+ * Test the ability to disable DDL update
*
* @author Emmanuel Bernard
*/
Show replies by date