1) With the latest SVN version, there exists a tableToMetaAttributes method which can add meta attributes to your hbm.xml files. Here is the code for the appropriate method of my ReverseEngineeringStrategy class:
Code:
public Map tableToMetaAttributes(TableIdentifier tableIdentifier) {
Map<String, MetaAttribute> metaAttributes = new HashMap<String, MetaAttribute>();
// Generate the class-code meta attribute to add a default
// serialVersionUID
MetaAttribute classCode = new MetaAttribute("class-code");
classCode.addValue("private static final long serialVersionUID = 1L;");
metaAttributes.put("class-code", classCode);
// Generate the extends meta attribute to extend all domain classes from
// BaseModel
MetaAttribute extendsCode = new MetaAttribute("extends");
extendsCode.addValue("BaseModel");
metaAttributes.put("extends", extendsCode);
return metaAttributes;
}
2) For now, you are better off overriding id.hbm.ftl template to make your own generator for your table identifiers, if you don't want to do it on a table-by-table basis in the reveng file. Just reply here if you need some assistance with that.