flatxmldatasets and database reserved words

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

flatxmldatasets and database reserved words

Mathias af Jochnick
Hi all,

i am working against a legacy Sybase database where two tables are set up with names that are reserved words in Sybase (user and order). In SQL and hibernate, they've gotten around this by using `user` and `order`.

However i haven't been able to find a way to do this with dbunit. If i use regular syntax, i.e.:

<order uidpk
....
/>

with the FlatXmlDataSet, i get an exception: org.dbunit.dataset.
NoSuchTableException: Did not find table 'ORDER' in schema (the table exists, i can query it directly)


I've looked around, tried the old "xmldataset" but that made no difference. I also thought that perhaps replacementdataset could be used somehow but it seems to only work on values, not table names from what i could see.



Optimally, there would be a way to define the flatxml structure even with tables that are named with reserved keywords.


Anybody have any pointers? Would be much appreciated.

Regards,

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: flatxmldatasets and database reserved words

Matthias Gommeringer
Hi there,

maybe it helps to use a custom metadatahandler? see
http://www.dbunit.org/apidocs/org/dbunit/database/IMetadataHandler.html and http://www.dbunit.org/properties.html
Not sure whether it is related to reserved words but you could find out by browsing the jdbc DatabaseMetaData object...

rgds,
matthias


Von: Mathias af Jochnick <[hidden email]>
Gesendet: 17.06.2010 11:08:46
An: [hidden email]
Betreff: [dbunit-user] flatxmldatasets and database reserved words

Hi all,

i am working against a legacy Sybase database where two tables are set up with names that are reserved words in Sybase (user and order). In SQL and hibernate, they've gotten around this by using `user` and `order`.

However i haven't been able to find a way to do this with dbunit. If i use regular syntax, i.e.:

<order uidpk
....
/>

with the FlatXmlDataSet, i get an exception: org.dbunit.dataset.
NoSuchTableException: Did not find table 'ORDER' in schema (the table exists, i can query it directly)


I've looked around, tried the old "xmldataset" but that made no difference. I also thought that perhaps replacementdataset could be used somehow but it seems to only work on values, not table names from what i could see.



Optimally, there would be a way to define the flatxml structure even with tables that are named with reserved keywords.


Anybody have any pointers? Would be much appreciated.

Regards,
  

WEB.DE DSL ab 19,99 Euro/Monat. Bis zu 150,- Euro Startguthaben und    
50,- Euro Geldprämie inklusive! https://freundschaftswerbung.web.de

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
___________________________________________________________
WEB.DE DSL ab 19,99 Euro/Monat. Bis zu 150,- Euro Startguthaben und
50,- Euro Geldprämie inklusive! https://freundschaftswerbung.web.de

_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user