Sebastian - Yes, I believe this is a bug. That being said, there might be already support for enabling escaping / delimiting table names in DBDictionary... I'd look myself, but I don't have a dev environment on this machine. Let us know what you find out.
Thanks, Rick On Mon, Feb 11, 2013 at 1:35 AM, seba.wag...@gmail.com < seba.wag...@gmail.com> wrote: > I might be willing to look into the OpenJPA source code to find out the > root of the issue, > but it would be good if somebody could confirm that this is a bug that > needs to be fixed. > > Sebastian > > > 2013/2/10 seba.wag...@gmail.com <seba.wag...@gmail.com> > > > Btw: The same issue exists with Postgres. We can't choose a table name > > "user" cause the SQL is not quoted in the sql for string "user". > > > > Sebastian > > > > > > 2013/2/10 seba.wag...@gmail.com <seba.wag...@gmail.com> > > > > Yes, > >> > >> actually you have those reserved keywords in all database. A subset of > >> those is common across all, some are special in each. > >> But of course it does not mean that those strings are "forbidden" to > use. > >> It simply means you have to escape them! (Or double quoting as the link > >> to the derby 10.8 docs say). > >> > >> For example the word "open" is also a reserved keyword according to the > >> list. But of course you can name a column "open" in OpenJPA, because it > is > >> somehow correctly escaped when the SQL is generated. "user" seems to be > not > >> correctly escaped. That is the problem. > >> > >> Sebastian > >> > >> > >> > >> 2013/2/10 Maxim Solodovnik <solomax...@gmail.com> > >> > >>> Hello Jesse, > >>> Thanks for the link! > >>> > >>> Is there any option to tell OpenJPA to generate derby compatible SQL? > >>> > >>> > >>> On Sat, Feb 9, 2013 at 8:11 PM, Jesse Farinacci <jie...@gmail.com> > >>> wrote: > >>> > >>> > Greetings, > >>> > > >>> > On Sat, Feb 9, 2013 at 12:15 AM, seba.wag...@gmail.com > >>> > <seba.wag...@gmail.com> wrote: > >>> > > we face an issue with OpenJPA 2.2.1 and Derby 10.8.2.2. > >>> > > When there is a table "user" the schema is correctly created > >>> > > with SynchronizeMappings. > >>> > > > >>> > > However making a query in the that database results in: > >>> > > org.apache.openjpa.persistence.PersistenceException: Syntax error: > >>> > > Encountered "user" at line 1, column 888. > >>> > > >>> > http://db.apache.org/derby/docs/10.8/ref/rrefkeywords29722.html > >>> > > >>> > -Jesse > >>> > > >>> > -- > >>> > There are 10 types of people in this world, those > >>> > that can read binary and those that can not. > >>> > > >>> > >>> > >>> > >>> -- > >>> WBR > >>> Maxim aka solomax > >>> > >> > >> > >> > >> -- > >> Sebastian Wagner > >> https://twitter.com/#!/dead_lock > >> http://www.webbase-design.de > >> http://www.wagner-sebastian.com > >> seba.wag...@gmail.com > >> > > > > > > > > -- > > Sebastian Wagner > > https://twitter.com/#!/dead_lock > > http://www.webbase-design.de > > http://www.wagner-sebastian.com > > seba.wag...@gmail.com > > > > > > -- > Sebastian Wagner > https://twitter.com/#!/dead_lock > http://www.webbase-design.de > http://www.wagner-sebastian.com > seba.wag...@gmail.com > -- *Rick Curtis*