Well, it's apparent you've never looked at the code Torque generates for
you, because every reference to the database name is hardcoded in the
BaseXXXPeer classes.
/** the default database name for this class */
public static final String DATABASE_NAME = "databaseName";
This is what seems grievous to me because it means you have to recompile
just to change the database name. To me, this seems to go against the nature
of Torque.
However, given what I learned from another post it *might* make sense if you
are using multiple database in your schema because then you're probably
using the save(String) method and not save() to specify your database.
Though I do disagree with this, if this is the proper use. Generated OM
classes should know what DBs they belong to so why would you need to specify
the db to save it to? Perhaps its just a case of incomplete documentation.
For my personal use I've changed the velocity templates so that in place of
the hardcoded db name it makes a call to torque to find out what it is based
on the runtime properties file. Another thing that seems funny to me is that
none of the other db parameters seem to be hardcoded: url, driver, user,
pass, etc. Why should db name be singled out?
Just a a confused lover of Torque,
Andrew
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Daniel Rall
Sent: Thursday, June 06, 2002 2:09 PM
To: Turbine Torque Developers List
Cc: [EMAIL PROTECTED]
Subject: Re: Why is the database name hardcoded EVERYWHERE?
"Andrew" <[EMAIL PROTECTED]> writes:
> Hi all,
>
> I was wondering what the logic of having the database name be hardcoded
is?
> This seems to me to make runtime changes and deployment impossible without
> recompiling. Why doesn't it just refer to what was passed in through the
> configuration file?
What the hell are you talking about? This sort of comment is not
useful; please cite a list of file names and line numbers from CVS
HEAD.
Thanks, Dan
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>