found the problem in org.exolab.castor.persist.SQLRelationLoader class.

not sure how other databases handle the below castor-generated query:

INSERT INTO odr_odrItem (odr_id,odrItem_id) VALUES ('192168001100104563263383600003','192168001100104563263383600002')

but the postgresql driver interprets the query as:

INSERT INTO odr_odritem (odr_id,odritem_id) VALUES ('192168001100104563263383600003','192168001100104563263383600002')

which is why if you define your many-table table names and field names with lowercase and uppercase letters (i.e. "odr_odrItem"), the exception:

java.sql.SQLException: ERROR: Relation "odr_odritem" does not exist

is thrown.

to solve this problem, i added quotes ("") around the table names and field names in the appropriate places in the SQLRelationLoader class, for which I have attached the modified source.

after the changes were applied, castor generates the following insert statement (notice the quotes around the table and field names):

INSERT INTO "odr_odrItem" ("odr_id","odrItem_id") VALUES ('192168001100104563263383600003','192168001100104563263383600002')

and the jdbc driver knows to preserve the case of the table and field names.

i've attached the new SQLRelationLoader.java file as well as a diff with the latest cvs. is this the correct way to get a patch in? for "record keeping", should a bug be filed in bugzilla?

thank you.



At 23:14 03/02/18 -0500, you wrote:
castor version: 0.9.4.3
db: postgresql
db version: 7.2.2
db jdbc driver: pg73jdbc3.jar

---------

hello.

all of the tables that i've been using with castor include lowercase and uppercase letters (i.e. "orderItem"), and they work fine. however, i just created my first MANY-TABLE whose table name and field names are also composed of lowercase and uppercase letters (i.e. table name = "order_orderItem"; field name = "orderId").

however, only for this MANY-TABLE, castor is complaining that it cannot find the table nor fields (indicating that the table name and fields name should be in ALL lowercase).

is there any special processing logic for the MANY-TABLEs? if so, what classes in the castor source should i look at?

has anyone had this problem with the MANY-TABLEs and lowercase/uppercase names?

thank you.
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev

Attachment: 20030218_SQLRelationLoader_addedQuotesAroundTableAndFieldNames.txt
Description: Binary data

Attachment: SQLRelationLoader.java
Description: Binary data

Reply via email to