-->
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.  [ 4 posts ] 
Author Message
 Post subject: hbm2java transforms tables' names to singular form.
PostPosted: Mon Aug 23, 2004 4:06 pm 
Newbie

Joined: Mon Aug 23, 2004 9:23 am
Posts: 12
Hibernate version: 2.1

The hbm2java tool has a default feature that I found quite annoying. I use ant (as explained in the provided examples) to generate java files and I want to obtain the code for all my tables ( so i don't want to specify any nested "table" element in the middlegen task). But, the name of tables that seems to be in plural ( "Persons" for example) get by default classes with names in singular ("Person" in this case).
I have read that singular and plural forms can be chosen using an attribute in the "table" element but as I said, I don't want to use "table" elements.
I just want classes with the same name that my database's tables have.
How could I avoid it?

Thanks and kind regards,
Jose Luis


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 23, 2004 4:33 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
set class name in preferences file.It is only way for now

regards


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 24, 2004 11:51 am 
Newbie

Joined: Mon Aug 02, 2004 6:07 pm
Posts: 1
I am facing the same problem. I am not able to get where that preference file is located?

Thanks,


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 24, 2004 4:01 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
MIDDLEGEN_HOME/src/<YourAppName>-prefs.properties

File exists after first call 'ant middlegen' - if You don't know app name see build.xml

regards


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

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.