[Opensource] Using DBObjects on tables that have keywords
as field names
Michael Rimov
rimovm at centercomp.com
Thu Mar 6 10:48:51 PST 2003
At 11:20 AM 3/6/2003 -0500, you wrote:
>So the changes I made were in DBObject, only about 6 one line changes in all
>(I didn't worry about table names, just field names for now, so that might
>make it 10 changes or so)
>
>Basically lines like this inside code that assembles
>SELECT/UPDATE/INSERT/DELETE statements:
>
> sqlCommand.append(oneField.getName());
>
>became:
>
>
>sqlCommand.append(DbReservedWordUtil.verifySafetyViaInstance(oneField.getNam
>e()));
>
>I just whipped it together so I didn't bother setting up my
>"DbReservedWordUtil" to work with multiple contexts. But it easily could
>be, and it's configuration could be setup in the expresso-config.xml
>file...sorta along the same lines as what Mike Rimov suggested in this
>lonely thread:
>
>http://mail.jcorporate.com/pipermail/opensource/2000-July/007436.html
>
>I think this solution works well, is there interest in incorporating
>something like this into the Expresso code base? It is definetly a handy
>feature to have, most importantly for folks who have to work with an
>existing database design that can't be modified.
Definitely! I'd love to see Expresso not having table names renamed every
time a new database is added to those that we support.
Since this would definitely be a 5.1 feature... can you write me offlist in
a couple of weeks so we could plan for integration. (Since the
configuration system is getting a new underpinnings, we'd be able to modify
it for 'per context' mapping pretty easily.
Thanks for the research!
-Mike
More information about the Opensource
mailing list