MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
thoism
Post subject: How to control Hibernate Reverese Eng. on naming conventions  PostPosted: Sep 01, 2006 - 08:37 AM
Registered Member
Registered Member


Joined: Aug 21, 2006
Posts: 1

Hello

I need to know if it's possible to control the Hibernate code generation to follow some naming conventions I want.
For example I want to avoid specific prefixes and suffixes on my class creation.
For example:
1. If the db table name is TBL_CUSTOMER I would like my resulting Hibernate class to be Customer.\
2. If the id column of the db table TBL_CUSTOMER is CUSTOMER_ID I would would like the resulting Customer class to have a corresponding property named id
3. If the table name starts with SPE_CUSTOMER I would like my resulting Hibernate class to reside in a package called com.spe so the class would be "...spe.Customer"

I checked some velocity templates that the documentation proposes but I dont have much time to spend on this. Can someone please give me some guidelines? Some examples.

I managed to do what I want with Hibernate Tools and the DelegatingReverseEngineeringStrategy class but Hibernate tools have other limitations on the DAO creation which MyEclipse is perfect on that.
If there is a way to create DAO objects from Hibernate mappings then my problem is also almost solved.

Thank you in advance...I am really having a difficult time here with the project deadlines :shock:
 
 View user's profile Send private message  
Reply with quote Back to top
Support-Brian
Post subject:   PostPosted: Sep 01, 2006 - 06:59 PM
Moderator
Moderator


Joined: Aug 21, 2004
Posts: 2512

Hi there,

I know what you're talking about, but I'm afraid we haven't yet integrated the DelegatingReverseEngineeringStrategy into MyEclipse.

The only way you can get what you want right away is to hard code the desired class name for each table on page 3 of the RE wizard. Make sure you use the fully qualified name.

Sorry about the inconvenience, but we will mostly likely be pulling in all these features into the next MyEcipse release.

Let us know if you require further assistance,
Brian.

_________________
Brian
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits