FAQ
Hi. I need to map a database schema which has reserverd words in column names
(with Cayenne 3.0 nad MSSQLServer). For example, the USER table has a column
called GROUP.

I solved partially the problem, by setting Cayenne to quote identifiers:

DataMap dataMap = new DataMap(DUMMY_NAME);
dataMap.setQuotingSQLIdentifiers(true);

but this just quotes columns in the SELECT section. This generated query fails:

SELECT [t0].[NAME], [t0].[GROUP], [t0].[ID] FROM [USER] [t0] WHERE t0.GROUP = ?
[bind: 1->GROUP:29]

because the GROUP column is used in the WHERE clause. Does anybody know if this
can be solved?

Thanks in advance.

Search Discussions

  • Andrus Adamchik at Nov 11, 2010 at 2:24 pm
    Looks like a bug to me. Appreciate if you could open a bug report, we'll take a look:

    https://issues.apache.org/jira/browse/CAY

    Thanks,
    Andrus
    On Nov 11, 2010, at 7:38 AM, Lautaro Brasseur wrote:

    Hi. I need to map a database schema which has reserverd words in column names
    (with Cayenne 3.0 nad MSSQLServer). For example, the USER table has a column
    called GROUP.

    I solved partially the problem, by setting Cayenne to quote identifiers:

    DataMap dataMap = new DataMap(DUMMY_NAME);
    dataMap.setQuotingSQLIdentifiers(true);

    but this just quotes columns in the SELECT section. This generated query fails:

    SELECT [t0].[NAME], [t0].[GROUP], [t0].[ID] FROM [USER] [t0] WHERE t0.GROUP = ?
    [bind: 1->GROUP:29]

    because the GROUP column is used in the WHERE clause. Does anybody know if this
    can be solved?

    Thanks in advance.

  • Casiyatrucha-cayenne at Nov 11, 2010 at 3:06 pm
    Done: https://issues.apache.org/jira/browse/CAY-1506

    Best regards

    Lautaro





    ________________________________
    De: Andrus Adamchik <andrus@objectstyle.org>
    Para: user@cayenne.apache.org
    Enviado: jueves, 11 de noviembre, 2010 11:24:42
    Asunto: Re: Reserverd words mapping question

    Looks like a bug to me. Appreciate if you could open a bug report, we'll take a
    look:


    https://issues.apache.org/jira/browse/CAY

    Thanks,
    Andrus
    On Nov 11, 2010, at 7:38 AM, Lautaro Brasseur wrote:

    Hi. I need to map a database schema which has reserverd words in column names
    (with Cayenne 3.0 nad MSSQLServer). For example, the USER table has a column
    called GROUP.

    I solved partially the problem, by setting Cayenne to quote identifiers:

    DataMap dataMap = new DataMap(DUMMY_NAME);
    dataMap.setQuotingSQLIdentifiers(true);

    but this just quotes columns in the SELECT section. This generated query fails:
    SELECT [t0].[NAME], [t0].[GROUP], [t0].[ID] FROM [USER] [t0] WHERE t0.GROUP = ?

    [bind: 1->GROUP:29]

    because the GROUP column is used in the WHERE clause. Does anybody know if this

    can be solved?

    Thanks in advance.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedNov 11, '10 at 12:50p
activeNov 11, '10 at 3:06p
posts3
users3
websitecayenne.apache.org

People

Translate

site design / logo © 2021 Grokbase