Humberto Hernandez Torres wrote:
> AFIK. The torque OMs can work gainst any database. This is not true. The Peer code has the database name for which they were generated hardcoded into them. Although, there are some methods which give impression you can change the database for which a OM class is targeted (eg. new Criteria(databaseName), if you actually try to use them, the code will fail b/c no database map* has been built for the database named at runtime. The database map is built/maintained by the <tableName>MapBuilder class that is generated as part of the OM generation. This class has a doBuild() method called when it is loaded that intiailizes databasemap for the database named when it was generated. What is needed is a way to a) assign an OM table to a database at runtime via the Peer and b) ability to generate database maps for a database other than the one for which OM was generated. It just so happens that I have a working solution to this problem which I can share if you want to contact me privately. I have not taken a "bug report" on scarab with my "fix" yet, though I have been instructed to do so by a developer. It is quite an easy patch, touching two templates (MapBuilder and Peer) and one class util/BasePeer. Rob * The database map is the table/column info for a table. > The sql files do need to > be generated for the specific database. > -- > Humberto > > > -----Original Message----- > > From: Eric Pugh [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 02, 2004 10:45 AM > > To: [EMAIL PROTECTED] > > Subject: Torque Objects for multiple databases > > > > > > When you compile some Torque objects for one database > > platform. Will they > > work against a different database? Or do you need to compile > > them for each > > type of database? Any approachs on how to handle the > > multiple different > > types of database at run time versus compile time? > > > > ERic > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED]
