Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-6351

org.hibernate.cfg.reveng.JDBCReader processTables() should support mixed-case names for TableTypes

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Blocker Blocker
    • 3.2.0.Beta1
    • 3.1.0.GA
    • hibernate
    • None

      A particular database (MetaMatrix/JBoss Enterprise Data Services Platform) returns mixed-case values from the JDBC call DatabaseMetadata.getTableTypes(), specifically: "Table", "View".

      However, line 539 of org.hibernate.cfg.reveng.JDBCReader expects these values to always be upper-case:

      if ( ("TABLE".equals(tableType) || "VIEW".equals(tableType)
      ...

      Upper-case values are typically expected here (see http://java.sun.com/j2se/1.4.2/docs/api/java/sql/DatabaseMetaData.html#getTableTypes%28%29), but not required per the JDBC specification AFAIK.

      Changing this logic to match on case-insensitive names allows Hibernate Tools to successfully work with MetaMatrix. For example:

      if ( ("TABLE".equalsIgnoreCase(tableType) || "VIEW".equalsIgnoreCase(tableType) /*|| "SYNONYM".equals(tableType) */) ) { //||

      See the forum thread for more info.

      I'll attach example code that was used to rebuild hibernate-tools.jar successfully, which contains only the change described above, in case it is useful.

            dgeraskov Dmitry Geraskov (Inactive)
            mwalker1@redhat.com Michael Walker (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: