I'm using sql2java with a mysql database, and I was wondering if there is a way to maintain my table and field capitalization scheme in the generated classes. For example, if I have a table:
CREATE TABLE `sportsGame` (
`gameId` int(10) unsigned NOT NULL auto_increment,
`awayScore` smallint(5) unsigned NOT NULL default '0',
`homeScore` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`gameId`)
);
I run generate on that table, the class names come out as SportsgameBean, SportsgameManager, etc., and the field names are gameid, awayscore, homescore. I'd really like to maintain the capitalization I used in the schema and have class names SportsGameBean, SportsGameManager, etc., and field names gameId, awayScore, homeScore. Is there a way to specify that in the configuration, or by modifying the templates?
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For the problem I outlined above, I just made a change to the StringUtilities.convertName(String, boolean) static method that helped conform the table and field names to our preferred style in java. The quick way to do it is by just removing the toLowerCase() before it is converted to a char array.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm using sql2java with a mysql database, and I was wondering if there is a way to maintain my table and field capitalization scheme in the generated classes. For example, if I have a table:
CREATE TABLE `sportsGame` (
`gameId` int(10) unsigned NOT NULL auto_increment,
`awayScore` smallint(5) unsigned NOT NULL default '0',
`homeScore` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`gameId`)
);
I run generate on that table, the class names come out as SportsgameBean, SportsgameManager, etc., and the field names are gameid, awayscore, homescore. I'd really like to maintain the capitalization I used in the schema and have class names SportsGameBean, SportsGameManager, etc., and field names gameId, awayScore, homeScore. Is there a way to specify that in the configuration, or by modifying the templates?
Thanks!
For the problem I outlined above, I just made a change to the StringUtilities.convertName(String, boolean) static method that helped conform the table and field names to our preferred style in java. The quick way to do it is by just removing the toLowerCase() before it is converted to a char array.