[hibernate-commits] Hibernate SVN: r10687 - in branches/Branch_3_2/HibernateExt/tools/src: templates/doc/entities test/org/hibernate/tool/hbm2x

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Thu Nov 2 10:06:17 EST 2006


Author: max.andersen at jboss.com
Date: 2006-11-02 10:06:13 -0500 (Thu, 02 Nov 2006)
New Revision: 10687

Modified:
   branches/Branch_3_2/HibernateExt/tools/src/templates/doc/entities/entity.ftl
   branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/DocExporterTest.java
Log:
HBX-804  Add inherited properties and id/property stubs

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/doc/entities/entity.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/doc/entities/entity.ftl	2006-11-02 14:57:25 UTC (rev 10686)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/doc/entities/entity.ftl	2006-11-02 15:06:13 UTC (rev 10687)
@@ -77,7 +77,7 @@
 							<#assign rowspan = property.getValue().getColumnSpan()>
 							<tr>
 								<td <#if (rowspan>0)>rowspan="${rowspan}"</#if>>
-									<a href="#field_summary">
+									<a href="#identifier_detail_${property.name}">
 										${property.name}
 									</a>
 								</td>
@@ -135,7 +135,7 @@
 					<#else>
 						<tr>
 							<td>
-								<a href="#field_summary">
+								<a href="#identifier_detail_${propertyIdentifier.name}">
 									${propertyIdentifier.name}
 								</a>
 							</td>
@@ -192,7 +192,7 @@
 						<#assign rowspan = property.getValue().getColumnSpan()>
 						<tr>
 							<td <#if (rowspan > 0)>rowspan="${rowspan}"</#if>>
-								<a href="#field_summary">
+								<a href="#property_detail_${property.name}">
 									${property.name}
 								</a>
 							</td>
@@ -255,5 +255,52 @@
 			</table>
 		</#if>
 
+		<#list superClasses as superClass>
+			<#assign properties = dochelper.getOrderedProperties(superClass)>
+			<#if !properties.empty>
+				<#assign superClassRef = docFileManager.getRef(docFile, docFileManager.getEntityDocFileByDeclarationName(superClass))>
+				<table id="properties_inherited_from_entity_${superClass.shortName}">
+					<tr>
+						<th>
+							Properties inherited from entity <a href="${superClassRef}">${superClass.shortName}</a>
+						</th>
+					</tr>
+					<tr>
+						<td>
+							<#list properties as property>
+								<a href="${superClassRef}#property_detail_${property.name}">${property.name}</a><#if property_has_next>, </#if>
+							</#list>
+						</td>
+					</tr>
+				</table>
+			</#if>
+		</#list>
+
+		<#if class.hasIdentifierProperty()>
+			<#assign identifier = class.getIdentifierProperty()>
+			<p id="identifier_detail" class="MainTableHeading">
+				Identifier Detail
+			</p>
+			<#if dochelper.getComponentPOJO(identifier)?exists>
+				<#assign identifierClass = dochelper.getComponentPOJO(identifier)>
+				<#foreach property in identifierClass.allPropertiesIterator>
+					<h3 id="identifier_detail_${property.name}">${property.name}</h3>
+				</#foreach>
+			<#else>
+				<h3 id="identifier_detail_${identifier.name}">${identifier.name}</h3>
+			</#if>
+		</#if>
+
+		<#assign properties = class.allPropertiesIterator>
+		<#if properties.hasNext()>
+			<p id="property_detail" class="MainTableHeading">
+				Property Detail
+			</p>
+			<#list properties as property>
+				<h3 id="property_detail_${property.name}">${property.name}</h3>
+				<hr/>
+			</#list>
+		</#if>
+
 	</body>
 </html>

Modified: branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/DocExporterTest.java
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/DocExporterTest.java	2006-11-02 14:57:25 UTC (rev 10686)
+++ branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/DocExporterTest.java	2006-11-02 15:06:13 UTC (rev 10687)
@@ -95,7 +95,14 @@
 		assertEquals("Generics syntax should not occur verbatim in html",null,findFirstString("List<", tableFile));
 		assertNotNull("Generics syntax occur verbatim in html",findFirstString("List&lt;", tableFile));
     }
+    
+	public void testInheritedProperties()
+	{
+		File entityFile = new File(getOutputDir(), "entities/org/hibernate/tool/hbm2x/UUser.html");
+		assertFileAndExists(entityFile);
 
+		assertNotNull("Missing inherited property", findFirstString("firstName", entityFile));
+	}
 
 	private void testHtml(final Tidy tidy, File dir) {
 		try {




More information about the hibernate-commits mailing list