Hmm...
I would create a custom template based on the hbm/persistentclass.hbm.ftl template. Right before the close tag you can insert Freemarker conditional logic based on the class name (of course, you can base the logic on any property you like, e.g. table name, schema, catalog, mutability, etc.).
Before:
Code:
<#foreach property in clazz.getUnjoinedPropertyIterator()>
<#include "${c2h.getTag(property)}.hbm.ftl"/>
</#foreach>
</${c2h.getTag(clazz)}>
After:
Code:
<#foreach property in clazz.getUnjoinedPropertyIterator()>
<#include "${c2h.getTag(property)}.hbm.ftl"/>
</#foreach>
<#if c2h.getClassName(clazz) == "org.mycompany.Person">
<meta attribute="class-code">
private String emailAddress;
public String getEmailAddress() {
return this.emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
</meta>
</#if>
</${c2h.getTag(clazz)}>
It may seem a bit intense, but you will only have to do this once and then subsequent code generations will stay true to your requirements.