[Opensource] Using DBObjects on tables that have keywords as
field names
Mike Traum
mtraum at cirnetwork.org
Wed Mar 5 16:50:05 PST 2003
Not sure, but it doesn't look like it's possible without modifying expresso.
You need to overload DBObjectDef.addField(), but allFields is private.
A quick fix that *might* (it looks like this is done to enforce
cross-compatibility and expresso doesn't really need it, but I haven't
investigated thoroughly) work would be to remove the isReservedWord test in
DBObjectDef.addField(). Generally, modifying Expresso yourself can be a bad
idea because you then get locked into the current version of expresso
without duplicating these changes in an upgrade. In this case, the changes
are simple enough that I'd go for it.
If you try the above and it works, let me know. I'll add a method to
DBObjectDef which won't check the reserved words.
You could, of course, drop DBObject and just use the connection pool to grab
a connection directly, but I'm sure that's not what you wanted to hear.
mike
-----Original Message-----
From: Dcomeau at xenos.com [mailto:Dcomeau at xenos.com]
Sent: Tuesday, March 04, 2003 7:30 PM
To: opensource at jcorporate.com
Subject: [Opensource] Using DBObjects on tables that have keywords as
field names
Hi All,
The Expresso app I'm writing is a component of suite of "executables" where
my Expresso app writes to the database tables and other components read from
it to perform business logic.
I have very little control over the format of the database as it was handed
to me along with the requirements for my component. And for some reason the
guys who built the tables decided to use SQL Server keywords for some of
their field names (ex: Column, Position, Section, Value).
And I just discovered that this is not doesn't go over too well when using
DBObjects.
I read this thread:
http://mail.jcorporate.com/pipermail/opensource/2001-November/009413.html
...but is there a way I can get around this with some Expresso parameters
rather than fighting to get the fields changed?
I'm way outnumbered and they've been plagued with tons of database changes
already as it is...they are writing a conversion utility to import data for
clients running a previous version of the product and are forced to modify
it each time there is a table change.
I have my fingers crossed but something tells me I'm not gonna like what I
hear! :P
Cheers
Dave
_______________________________________________
Opensource mailing list
Opensource at jcorporate.com
http://mail.jcorporate.com/mailman/listinfo/opensource
Archives: http://mail.jcorporate.com/pipermail/opensource/
More information about the Opensource
mailing list