3.3 Custom strategy
It is possible to implement a user strategy. Such strategy must implement org.hibernate.cfg.reveng.ReverseEngineeringStrategy.
It is recommended that one uses the DelegatingReverseEngineeringStrategy and provide a public constructor which takes another ReverseEngineeringStrategy as argument. This will allow you to only implement the relevant methods and provide a fallback strategy.
Example of custom delegating strategy which converts all column names that endswith "PK" into a property named "id".
public class ExampleStrategy extends DelegatingReverseEngineeringStrategy {
public ExampleStrategy(ReverseEngineeringStrategy delegate) {
super(delegate);
}
public String columnToPropertyName(TableIdentifier table, String column) {
if(column.endsWith("PK")) {
return "id";
} else {
return super.columnToPropertyName(table, column);
}
}
}
http://www.hibernate.org/hib_docs/tools/ant/