Cayenne
  1. Cayenne
  2. CAY-1645

Table case in CreateIfNoSchemaStrategy causes problems with HSQLDB

    Details

    • Type: Task Task
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.1B1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      In CreateIfNoSchemaStrategy, I have run into problems with HSQLDB and upper/mixed case table names. (By default HSQLDB converts table and field names all to upper case, and is case sensitive):

      In particular, if I lower or mixed case my DBEntity name, the resulting tables are not found by CreateIfNoSchemaStrategy when I use HSQLDB.

      I found that if I convert all table name checks to upper case, then CreateIfNoSchemaStrategy finds the existing table and does not try to regenerate it.

      Is this a general solution? Will it break anything else?

      My solution was to change:

      +-line 51:
      while (it.hasNext()) {
      if (nameTables.get(it.next().getName().toUpperCase()) != null)

      { generate = false; break; }

      }

      and

      +- line 108:
      while (rs.next())

      { String name = rs.getString("TABLE_NAME"); nameTables.put(name.toUpperCase(), false); }

      ref:
      http://cayenne.markmail.org/message/m3wphbhol47vbpnb

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Kevin Meyer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development