-->
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.  [ 10 posts ] 
Author Message
 Post subject: Middlegen - strips off character.
PostPosted: Mon Nov 03, 2003 4:48 pm 
Beginner
Beginner

Joined: Thu Sep 25, 2003 5:22 pm
Posts: 29
Location: NC
I have a table called, for example, BANK_ATS. When I used Middlegen (r3) to generate this table, it names my hbm.xml file BankAt.hbm.xml and then hbm2java creates the java file as BankAt.java. I am not specifying specific tables, just letting Middlegen generate every table in my schema. Any suggestions why this might be happening and what I might do to fix it?

Thanks,
-Kat


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 03, 2003 5:15 pm 
Beginner
Beginner

Joined: Thu Sep 25, 2003 5:22 pm
Posts: 29
Location: NC
Oops, I meant to say I use Middlegen to generate my mapping files from my already existing database. The BANK_ATS table exists in that database.

-K


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 03, 2003 6:14 pm 
Beginner
Beginner

Joined: Tue Aug 26, 2003 2:46 pm
Posts: 45
Location: Saskatoon SK Canada
I believe that behaviour is intended - Middlegen/Hibernate is assuming that the table name is plural, so when it builds the object, it uses the singular.

However, there are problems when it misinterprets the plural -- e.g. It takes the table SERVICE_TYPES and turns it into ServiceTyp.


Maury...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 03, 2003 8:49 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
As correctly stated Middlegen changes (what it thinks is) plural to singular. This is a core feature of Middlegen thus changing it is difficult. Hence, I have start on, and am planning to finished the ability to define your own class names and/or property names using the plugin. The GUI is done but as you would be aware you cannot edit the name. This will be enabled. I have this on my list for release 4.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 04, 2003 11:17 am 
Beginner
Beginner

Joined: Thu Sep 25, 2003 5:22 pm
Posts: 29
Location: NC
Hmm... I am not sure why if the table name is plural that the 's' shouldn't just be left alone. Sort of like how MSWord auto-capitalizes my words when I want it to just take my input as I type it in.

Oh well, I guess I still get to edit by hand for a while. But thanks for fixing that composite foreign key issue!

-Kat


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 04, 2003 5:35 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
No problem. This one is a middlegen core issue. As I said I will work around it in the plugin in r4.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 18, 2003 6:37 pm 
Beginner
Beginner

Joined: Tue Aug 26, 2003 2:46 pm
Posts: 45
Location: Saskatoon SK Canada
Kat wrote:
Hmm... I am not sure why if the table name is plural that the 's' shouldn't just be left alone.


I would guess that the thinking around that is:

Since a java class represents a single object, Middlegen makes the name singular (e.g. a class represents an instance of a single Service Type). The database table contains many instances of the that object, so it is plural (e.g. many Service Types).


Maury...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 18, 2003 7:45 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Yes - Thats how I work (this was the case before Middlegen as well). It is logical but does not universally apply. People are people - being different makes people and life interesting.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 19, 2003 1:18 pm 
Beginner
Beginner

Joined: Thu Sep 25, 2003 5:22 pm
Posts: 29
Location: NC
We just renamed the table, btw. Since we are still in dev stages, it wasn't that difficult. The table in question was an abbreviation of a phrase that ended in "service" and not a plural. We just added another word to the table name and now it doesn't think that abbreviation is plural. Like David said, people are people... luckily we are adaptable as well as different and interesting. :)

-Kat


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 19, 2003 7:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
:-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 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.