[hibernate-commits] Hibernate SVN: r18746 - branches/Branch_3_2/HibernateExt/tools/src/templates/hbm.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Tue Feb 9 12:31:18 EST 2010


Author: max.andersen at jboss.com
Date: 2010-02-09 12:31:18 -0500 (Tue, 09 Feb 2010)
New Revision: 18746

Added:
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/collection-tableattr.hbm.ftl
Modified:
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/array.hbm.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/bag.hbm.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/idbag.hbm.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/list.hbm.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/map.hbm.ftl
   branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/set.hbm.ftl
Log:
added multi catalog/schema generation support to the remaining collection types (array, bag, idbag, list, map)

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/array.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/array.hbm.ftl	2010-02-09 13:00:22 UTC (rev 18745)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/array.hbm.ftl	2010-02-09 17:31:18 UTC (rev 18746)
@@ -6,7 +6,7 @@
 
 <array name="${property.name}"
 	<#if value.elementClassName?exists> element-class="${value.elementClassName}"</#if>
-	table="${value.collectionTable.quotedName}"
+	<#include "collection-tableattr.hbm.ftl">
 	<#if property.cascade != "none">
         cascade="${property.cascade}"
 	</#if>

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/bag.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/bag.hbm.ftl	2010-02-09 13:00:22 UTC (rev 18745)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/bag.hbm.ftl	2010-02-09 17:31:18 UTC (rev 18746)
@@ -3,7 +3,9 @@
 <#assign elementValue = value.getElement()>
 <#assign elementTag = c2h.getCollectionElementTag(property)>
 
-	<bag name="${property.name}" table="${value.collectionTable.quotedName}" inverse="${value.inverse?string}"
+	<bag name="${property.name}" 
+	<#include "collection-tableattr.hbm.ftl"> 
+	inverse="${value.inverse?string}"
 	lazy="${c2h.getCollectionLazy(value)}"
 	<#if property.cascade != "none">
         cascade="${property.cascade}"

Added: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/collection-tableattr.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/collection-tableattr.hbm.ftl	                        (rev 0)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/collection-tableattr.hbm.ftl	2010-02-09 17:31:18 UTC (rev 18746)
@@ -0,0 +1,7 @@
+table="${value.collectionTable.quotedName}"
+<#if value.collectionTable.catalog?exists && ((clazz.table.catalog?exists && clazz.table.catalog!=value.collectionTable.catalog) || (!clazz.table.catalog?exists && value.collectionTable.catalog?exists)) >
+catalog="${value.collectionTable.catalog}"
+</#if>
+<#if value.collectionTable.schema?exists && ((clazz.table.schema?exists && clazz.table.schema!=value.collectionTable.schema) || (!clazz.table.schema?exists && value.collectionTable.schema?exists)) >
+schema="${value.collectionTable.quotedSchema}"
+</#if>
\ No newline at end of file

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/idbag.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/idbag.hbm.ftl	2010-02-09 13:00:22 UTC (rev 18745)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/idbag.hbm.ftl	2010-02-09 17:31:18 UTC (rev 18746)
@@ -3,7 +3,8 @@
 <#assign elementValue = value.getElement()>
 <#assign elementTag = c2h.getCollectionElementTag(property)>
 
-	<idbag name="${property.name}" table="${value.collectionTable.quotedName}"
+	<idbag name="${property.name}" 
+	<#include "collection-tableattr.hbm.ftl">
 	lazy="${c2h.getCollectionLazy(value)}"
 	<#if property.cascade != "none">
         cascade="${property.cascade}"

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/list.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/list.hbm.ftl	2010-02-09 13:00:22 UTC (rev 18745)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/list.hbm.ftl	2010-02-09 17:31:18 UTC (rev 18746)
@@ -4,11 +4,13 @@
 <#assign indexValue = value.getIndex()>
 <#assign elementTag = c2h.getCollectionElementTag(property)>
 
-	<list name="${property.name}" inverse="${value.inverse?string}" table="${value.collectionTable.quotedName}"
+	<list name="${property.name}" inverse="${value.inverse?string}" 
+	<#include "collection-tableattr.hbm.ftl"> 
 	lazy="${c2h.getCollectionLazy(value)}"
 	<#if property.cascade != "none">
         cascade="${property.cascade}"
 	</#if>
+		
 	<#if c2h.hasFetchMode(property)> fetch="${c2h.getFetchMode(property)}"</#if>>
 		<#assign metaattributable=property>
 		<#include "meta.hbm.ftl">

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/map.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/map.hbm.ftl	2010-02-09 13:00:22 UTC (rev 18745)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/map.hbm.ftl	2010-02-09 17:31:18 UTC (rev 18746)
@@ -4,7 +4,8 @@
 <#assign indexValue = value.getIndex()>
 <#assign elementTag = c2h.getCollectionElementTag(property)>
 
-	<map name="${property.name}" table="${value.collectionTable.quotedName}"
+	<map name="${property.name}"
+	<#include "collection-tableattr.hbm.ftl">
 	lazy="${c2h.getCollectionLazy(value)}"
 	<#if property.cascade != "none">
         cascade="${property.cascade}"

Modified: branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/set.hbm.ftl
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/set.hbm.ftl	2010-02-09 13:00:22 UTC (rev 18745)
+++ branches/Branch_3_2/HibernateExt/tools/src/templates/hbm/set.hbm.ftl	2010-02-09 17:31:18 UTC (rev 18746)
@@ -3,16 +3,10 @@
 <#assign elementValue = value.getElement()>
 <#assign elementTag = c2h.getCollectionElementTag(property)>
 
-	<set name="${property.name}" 
+	<set name="${property.name}"
+	<#include "collection-tableattr.hbm.ftl"> 
 	inverse="${value.inverse?string}"
-	lazy="${c2h.getCollectionLazy(value)}" 
-	table="${value.collectionTable.name}"
-	<#if value.collectionTable.catalog?exists && ((clazz.table.catalog?exists && clazz.table.catalog!=value.collectionTable.catalog) || (!clazz.table.catalog?exists && value.collectionTable.catalog?exists)) >
-    catalog="${value.collectionTable.catalog}"
-	</#if>
-	<#if value.collectionTable.schema?exists && ((clazz.table.schema?exists && clazz.table.schema!=value.collectionTable.schema) || (!clazz.table.schema?exists && value.collectionTable.schema?exists)) >
-    schema="${value.collectionTable.quotedSchema}"
-	</#if>	
+	lazy="${c2h.getCollectionLazy(value)}"	 		
 	<#if property.cascade != "none">
         cascade="${property.cascade}"
 	</#if>



More information about the hibernate-commits mailing list