Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-1506

Reserverd words mapping in WHERE clause

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0
    • 3.0.2
    • Core Library
    • None
    • Cayenne 3.0 + MSSQLServer (running in an OSGi environment)

    Description

      I need to map a database schema which has reserverd words in column names. 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 and it is not quoted.

      Attachments

        Issue Links

          Activity

            People

              cayenne_olga Olga Tkacheva
              lbrasseur Lautaro Brasseur
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: