-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hiberante DelegatingReverseEngineeringStrategy
PostPosted: Wed Jun 05, 2013 5:18 am 
Newbie

Joined: Wed Jun 05, 2013 5:01 am
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.