|
From: <hib...@li...> - 2006-07-28 19:16:00
|
Author: max...@jb...
Date: 2006-07-26 11:13:29 -0400 (Wed, 26 Jul 2006)
New Revision: 10166
Modified:
trunk/HibernateExt/tools/src/templates/hbm/set.hbm.ftl
trunk/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest.java
Log:
many-to-many to hbm.xml
Modified: trunk/HibernateExt/tools/src/templates/hbm/set.hbm.ftl
===================================================================
--- trunk/HibernateExt/tools/src/templates/hbm/set.hbm.ftl 2006-07-26 15:12:52 UTC (rev 10165)
+++ trunk/HibernateExt/tools/src/templates/hbm/set.hbm.ftl 2006-07-26 15:13:29 UTC (rev 10166)
@@ -16,7 +16,7 @@
/>
<#elseif c2h.isManyToMany(property)>
<many-to-many
- entity-name="$c2h.getClassName($property.getValue().getElement())"> <#-- lookup needed classname -->
+ entity-name="${property.getValue().getElement().getReferencedEntityName()}"> <#-- lookup needed classname -->
<#foreach column in property.getValue().getElement().columnIterator>
<#include "column.hbm.ftl">
</#foreach>
Modified: trunk/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest.java
===================================================================
--- trunk/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest.java 2006-07-26 15:12:52 UTC (rev 10165)
+++ trunk/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest.java 2006-07-26 15:13:29 UTC (rev 10166)
@@ -64,7 +64,7 @@
}
- public void testManyToManyFailureExpected() throws DocumentException {
+ public void testManyToMany() throws DocumentException {
File outputXml = new File(getOutputDir(), getBaseForMappings() + "User.hbm.xml");
assertFileAndExists(outputXml);
@@ -76,7 +76,7 @@
List list = xpath.selectNodes(document);
assertEquals("Expected to get one many-to-many element", 1, list.size());
Element node = (Element) list.get(0);
- assertEquals(node.attribute( "class" ).getText(),"Group");
+ assertEquals(node.attribute( "entity-name" ).getText(),"org.hibernate.tool.hbm2x.hbm2hbmxml.Group");
}
|