Thanks, Max!
Some explanations for a probably simple question at the end...
This is what I got so far:
In build.xml:
Code:
<hbmtemplate template="my-mapping.hbm.ftl"
...
In
my-mapping.hbm.ftl I have all that is in
persistentclass.hbm.ftl plus:
Code:
<#foreach join in clazz.getJoinIterator()>
<#include "join.hbm.ftl"/>
</#foreach>
Now I'm not sure how to access the join in
join.hbm.ftl. Looking at
set.hbm.ftl and others, I noticed that the interpolation "property" is accessed - this is something that could teach me how to do it:
Code:
<set name="${property.name}"
...
I'm still puzzled because I don't see where "property" is set. The only place I found is in
persistentclass.hbm.ftl:
Code:
<#foreach property in clazz.getUnjoinedPropertyIterator()>
<#if c2h.getTag(property)!="version" && c2h.getTag(property)!="timestamp">
<#include "${c2h.getTag(property)}.hbm.ftl"/>
</#if>
</#foreach>
So there you have a place where it is assigned (foreach property in ...), but it's in another template, not the template for the set. Are these variables somehow magically handed over between templates?
What I would like to be able to write in
join.hbm.ftl is this:
Code:
<join
table="${join.getTable().getName()}"
inverse="${join.inverse?string}"
...
So how do I make the variable "join" known to the template
join.hbm.ftl?