[hibernate-commits] Hibernate SVN: r11679 - in branches/Branch_3_2/HibernateExt/tools/src: templates/hbm and 1 other directories.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Mon Jun 11 09:24:05 EDT 2007


Author: max.andersen at jboss.com
Date: 2007-06-11 09:24:05 -0400 (Mon, 11 Jun 2007)
New Revision: 11679

Modified:
   branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/ConfigurationNavigator.java
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/component.hbm.ftl
   branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/Hbm2XAllTests.java
Log:
HBX-267 handle <properties> in hbm2java 

Modified: branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/ConfigurationNavigator.java
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/ConfigurationNavigator.java	2007-06-11 12:05:43 UTC (rev 11678)
+++ branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/ConfigurationNavigator.java	2007-06-11 13:24:05 UTC (rev 11679)
@@ -87,7 +87,8 @@
 	private static void collectComponents(Map components, Iterator iter) {
 		while(iter.hasNext()) {
 			Property property = (Property) iter.next();
-			if (property.getValue() instanceof Component) {
+			if (!"embedded".equals(property.getPropertyAccessorName()) && // HBX-267, embedded property for <properties> should not be generated as component. 
+				property.getValue() instanceof Component) {
 				Component comp = (Component) property.getValue();
 				addComponent( components, comp );			
 			} 
@@ -111,7 +112,7 @@
 			}
 		} else {
 			log.debug("dynamic-component found. Ignoring it as a component, but will collect any embedded components.");
-		}
+		}	
 		collectComponents( components, new ComponentPOJOClass(comp, new Cfg2JavaTool()).getAllPropertiesIterator());		
 	}
 

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/component.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/component.hbm.ftl	2007-06-11 12:05:43 UTC (rev 11678)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/component.hbm.ftl	2007-06-11 13:24:05 UTC (rev 11679)
@@ -1,3 +1,4 @@
+
 <component 
     name="${property.name}"
     class="${property.value.componentClassName}">
@@ -4,5 +5,5 @@
     <#assign metaattributable=property>
 	<#include "meta.hbm.ftl">
     
-<!-- TODO -->    
+<!-- TODO: handle properties and component -->    
 </component>
\ No newline at end of file

Modified: branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/Hbm2XAllTests.java
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/Hbm2XAllTests.java	2007-06-11 12:05:43 UTC (rev 11678)
+++ branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/Hbm2XAllTests.java	2007-06-11 13:24:05 UTC (rev 11679)
@@ -25,6 +25,7 @@
 		suite.addTestSuite( Hbm2HibernateDAOTest.class );
 		suite.addTestSuite( DocExporterTest.class );
 		suite.addTestSuite( Hbm2SeamTest.class );
+		suite.addTestSuite( PropertiesTest.class );
 		//$JUnit-END$
 		return suite;
 	}




More information about the hibernate-commits mailing list