Hi,
I have created Domain class from database tables using hibernate reverse engineering wizard in JBoss Developer Studio IDE (similar to Eclipse). The default naming convention of generated the class is camel notation of the table name i.e. if table is Employee_Master, domain class generated is employeeMaster.java I want the domain class name to be custom. eg; employeeMasterEntity.java
Searching it on google I found that I need to override tableToClassName method of DelegatingReverseEngineeringStrategy class. Though I have written the overridden method :
public class CustomNaming extends DelegatingReverseEngineeringStrategy { public CustomNaming(ReverseEngineeringStrategy delegate) { super(delegate); // TODO Auto-generated constructor stub }
public String tableToClassName(TableIdentifier tableIdentifier) { String className = super.tableToClassName(tableIdentifier); return className+"Entity"; } }
I am not sure how should I specify in the IDE's Hibernate Code generation console to pick this version of method so that next time it generates domain class, it overrides the tableToClassName method. Can you please help me to show a proper way to use this class
Thanks, Ashwin
|