[hibernate-commits] Hibernate SVN: r10548 - trunk/HibernateExt/tools/src/templates/hbm
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Tue Oct 3 19:53:01 EDT 2006
Author: max.andersen at jboss.com
Date: 2006-10-03 19:52:56 -0400 (Tue, 03 Oct 2006)
New Revision: 10548
Added:
trunk/HibernateExt/tools/src/templates/hbm/meta.hbm.ftl
Modified:
trunk/HibernateExt/tools/src/templates/hbm/array.hbm.ftl
trunk/HibernateExt/tools/src/templates/hbm/bag.hbm.ftl
trunk/HibernateExt/tools/src/templates/hbm/component.hbm.ftl
trunk/HibernateExt/tools/src/templates/hbm/id.hbm.ftl
trunk/HibernateExt/tools/src/templates/hbm/list.hbm.ftl
trunk/HibernateExt/tools/src/templates/hbm/many-to-one.hbm.ftl
trunk/HibernateExt/tools/src/templates/hbm/persistentclass.hbm.ftl
trunk/HibernateExt/tools/src/templates/hbm/primitive-array.hbm.ftl
trunk/HibernateExt/tools/src/templates/hbm/property.hbm.ftl
trunk/HibernateExt/tools/src/templates/hbm/set.hbm.ftl
trunk/HibernateExt/tools/src/templates/hbm/timestamp.hbm.ftl
trunk/HibernateExt/tools/src/templates/hbm/version.hbm.ftl
Log:
HBX-767 generate meta in hbm2hbmxml
Modified: trunk/HibernateExt/tools/src/templates/hbm/array.hbm.ftl
===================================================================
--- trunk/HibernateExt/tools/src/templates/hbm/array.hbm.ftl 2006-10-03 23:50:05 UTC (rev 10547)
+++ trunk/HibernateExt/tools/src/templates/hbm/array.hbm.ftl 2006-10-03 23:52:56 UTC (rev 10548)
@@ -9,6 +9,8 @@
<#assign toManyClass = value.getElement().getType().getAssociatedEntityName()>
</#if>
<array name="${property.name}" cascade="${property.cascade}"
+ <#assign metaattributable=property>
+ <#include "meta.hbm.ftl">
<#if c2h.hasFetchMode(property)> fetch="${fetch}"</#if>>
<key>
<#foreach column in dependentValue.columnIterator>
Modified: trunk/HibernateExt/tools/src/templates/hbm/bag.hbm.ftl
===================================================================
--- trunk/HibernateExt/tools/src/templates/hbm/bag.hbm.ftl 2006-10-03 23:50:05 UTC (rev 10547)
+++ trunk/HibernateExt/tools/src/templates/hbm/bag.hbm.ftl 2006-10-03 23:52:56 UTC (rev 10548)
@@ -2,6 +2,9 @@
name="${property.name}"
inverse="${property.value.inverse?string}"
>
+ <#assign metaattributable=property>
+ <#include "meta.hbm.ftl">
+
<key>
<#foreach column in property.value.key.columnIterator>
<#include "column.hbm.ftl">
Modified: trunk/HibernateExt/tools/src/templates/hbm/component.hbm.ftl
===================================================================
--- trunk/HibernateExt/tools/src/templates/hbm/component.hbm.ftl 2006-10-03 23:50:05 UTC (rev 10547)
+++ trunk/HibernateExt/tools/src/templates/hbm/component.hbm.ftl 2006-10-03 23:52:56 UTC (rev 10548)
@@ -1,5 +1,8 @@
<component
name="${property.name}"
class="${property.value.componentClassName}">
+ <#assign metaattributable=property>
+ <#include "meta.hbm.ftl">
+
<!-- TODO -->
</component>
\ No newline at end of file
Modified: trunk/HibernateExt/tools/src/templates/hbm/id.hbm.ftl
===================================================================
--- trunk/HibernateExt/tools/src/templates/hbm/id.hbm.ftl 2006-10-03 23:50:05 UTC (rev 10547)
+++ trunk/HibernateExt/tools/src/templates/hbm/id.hbm.ftl 2006-10-03 23:52:56 UTC (rev 10548)
@@ -27,6 +27,9 @@
access="${property.propertyAccessorName}"
</#if>
>
+ <#assign metaattributable=property>
+ <#include "meta.hbm.ftl">
+
<#foreach column in property.columnIterator>
<#include "pkcolumn.hbm.ftl">
</#foreach>
Modified: trunk/HibernateExt/tools/src/templates/hbm/list.hbm.ftl
===================================================================
--- trunk/HibernateExt/tools/src/templates/hbm/list.hbm.ftl 2006-10-03 23:50:05 UTC (rev 10547)
+++ trunk/HibernateExt/tools/src/templates/hbm/list.hbm.ftl 2006-10-03 23:52:56 UTC (rev 10548)
@@ -2,6 +2,9 @@
name="${property.name}"
inverse="${property.value.inverse?string}"
>
+ <#assign metaattributable=property>
+ <#include "meta.hbm.ftl">
+
<key>
<#foreach column in property.value.key.columnIterator>
<#include "column.hbm.ftl">
Modified: trunk/HibernateExt/tools/src/templates/hbm/many-to-one.hbm.ftl
===================================================================
--- trunk/HibernateExt/tools/src/templates/hbm/many-to-one.hbm.ftl 2006-10-03 23:50:05 UTC (rev 10547)
+++ trunk/HibernateExt/tools/src/templates/hbm/many-to-one.hbm.ftl 2006-10-03 23:52:56 UTC (rev 10548)
@@ -25,11 +25,11 @@
<#if formula>
formula="${formula.text}"
</#if>
- />
-<#else>
+</#if>
>
+ <#assign metaattributable=property>
+ <#include "meta.hbm.ftl">
<#foreach column in property.columnIterator>
<#include "column.hbm.ftl">
</#foreach>
</many-to-one>
-</#if>
Added: trunk/HibernateExt/tools/src/templates/hbm/meta.hbm.ftl
===================================================================
--- trunk/HibernateExt/tools/src/templates/hbm/meta.hbm.ftl 2006-10-03 23:50:05 UTC (rev 10547)
+++ trunk/HibernateExt/tools/src/templates/hbm/meta.hbm.ftl 2006-10-03 23:52:56 UTC (rev 10548)
@@ -0,0 +1,7 @@
+<#if metaattributable.getMetaAttributes()?exists>
+<#list metaattributable.getMetaAttributes().keySet() as key>
+ <#list metaattributable.getMetaAttributes().get(key).values as value>
+ <meta attribute="${key}" inherit="false">${value}</meta>
+ </#list>
+</#list>
+</#if>
\ No newline at end of file
Modified: trunk/HibernateExt/tools/src/templates/hbm/persistentclass.hbm.ftl
===================================================================
--- trunk/HibernateExt/tools/src/templates/hbm/persistentclass.hbm.ftl 2006-10-03 23:50:05 UTC (rev 10547)
+++ trunk/HibernateExt/tools/src/templates/hbm/persistentclass.hbm.ftl 2006-10-03 23:52:56 UTC (rev 10548)
@@ -59,6 +59,9 @@
<#if clazz.table.rowId?exists>
rowid="${clazz.table.rowId}"
</#if>>
+<#assign metaattributable=clazz/>
+<#include "meta.hbm.ftl"/>
+
<#if clazz.table.comment?exists>
<comment>${clazz.table.comment}</comment>
</#if>
Modified: trunk/HibernateExt/tools/src/templates/hbm/primitive-array.hbm.ftl
===================================================================
--- trunk/HibernateExt/tools/src/templates/hbm/primitive-array.hbm.ftl 2006-10-03 23:50:05 UTC (rev 10547)
+++ trunk/HibernateExt/tools/src/templates/hbm/primitive-array.hbm.ftl 2006-10-03 23:52:56 UTC (rev 10548)
@@ -1,5 +1,7 @@
<#assign value = property.value><#assign table = value.getElement().getTable().getName()><#assign dependentValue = value.getKey()>
<primitive-array name="${property.name}" table="${table}">
+ <#assign metaattributable=property>
+ <#include "meta.hbm.ftl">
<key>
<#foreach column in dependentValue.getColumnIterator()>
<#include "column.hbm.ftl">
Modified: trunk/HibernateExt/tools/src/templates/hbm/property.hbm.ftl
===================================================================
--- trunk/HibernateExt/tools/src/templates/hbm/property.hbm.ftl 2006-10-03 23:50:05 UTC (rev 10547)
+++ trunk/HibernateExt/tools/src/templates/hbm/property.hbm.ftl 2006-10-03 23:52:56 UTC (rev 10548)
@@ -21,10 +21,12 @@
<#if formula?has_content>
formula="${formula.text}"
</#if>
- />
-<#else>
+</#if>
>
+ <#assign metaattributable=property>
+ <#include "meta.hbm.ftl">
<#foreach column in property.columnIterator>
<#include "column.hbm.ftl">
- </#foreach> </property>
-</#if>
+ </#foreach>
+ </property>
+
Modified: trunk/HibernateExt/tools/src/templates/hbm/set.hbm.ftl
===================================================================
--- trunk/HibernateExt/tools/src/templates/hbm/set.hbm.ftl 2006-10-03 23:50:05 UTC (rev 10547)
+++ trunk/HibernateExt/tools/src/templates/hbm/set.hbm.ftl 2006-10-03 23:52:56 UTC (rev 10548)
@@ -5,6 +5,8 @@
table="${property.value.collectionTable.name}"
</#if>
>
+ <#assign metaattributable=property>
+ <#include "meta.hbm.ftl">
<key>
<#foreach column in property.value.key.columnIterator>
<#include "column.hbm.ftl">
Modified: trunk/HibernateExt/tools/src/templates/hbm/timestamp.hbm.ftl
===================================================================
--- trunk/HibernateExt/tools/src/templates/hbm/timestamp.hbm.ftl 2006-10-03 23:50:05 UTC (rev 10547)
+++ trunk/HibernateExt/tools/src/templates/hbm/timestamp.hbm.ftl 2006-10-03 23:52:56 UTC (rev 10548)
@@ -1,7 +1,7 @@
<timestamp
name="${property.name}"
<#if !property.basicPropertyAccessor> access="${property.propertyAccessorName}"
-</#if><#foreach column in property.columnIterator> <#-- always only one column, but no direct access method.
---> column="${column.quotedName}"
+</#if><#foreach column in property.columnIterator> <#-- always only one column, but no direct access method.-->
+ column="${column.quotedName}"
</#foreach> />
Modified: trunk/HibernateExt/tools/src/templates/hbm/version.hbm.ftl
===================================================================
--- trunk/HibernateExt/tools/src/templates/hbm/version.hbm.ftl 2006-10-03 23:50:05 UTC (rev 10547)
+++ trunk/HibernateExt/tools/src/templates/hbm/version.hbm.ftl 2006-10-03 23:52:56 UTC (rev 10548)
@@ -3,5 +3,8 @@
type="${property.value.typeName}"
<#if !property.basicPropertyAccessor> access="${property.propertyAccessorName}"
</#if> >
-<#foreach column in property.columnIterator> <#include "column.hbm.ftl"></#foreach> </version>
+<#foreach column in property.columnIterator>
+ <#include "column.hbm.ftl">
+</#foreach>
+ </version>
More information about the hibernate-commits
mailing list