Uploaded image for project: 'DdlUtils'
  1. DdlUtils
  2. DDLUTILS-239

NullPointerException in JdbcModelReader.readTable (fix included)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.0
    • None
    • None
    • Oracle 9i with nested tables

    Description

      JdbcModelReader

      protected Table readTable(DatabaseMetaDataWrapper metaData, Map values) throws SQLException

      for (Iterator it = primaryKeys.iterator(); it.hasNext()

      { table.findColumn((String)it.next(), true).setPrimaryKey(true); }

      This happens on Oracle 9i, but it could happen with other dbs.
      There are inner tables which have no columns, but do have a PKs defined.

      findColumn() returns null and the code tries to set a value on it

      To get past this:

      for (Iterator it = primaryKeys.iterator(); it.hasNext() {
      String pk = (String)it.next();
      Column col = table.findColumn(pk, true);
      if(col == null)

      {continue;}

      col.setPrimaryKey(true);
      // table.findColumn((String)it.next(), true).setPrimaryKey(true);
      }

      I'm not sure what a this means for the the xml output.
      IMO, a comment should be added to xml output stating what was skipped.

      Thanks, Dave

      Attachments

        Activity

          People

            tomdz Thomas Dudziak
            velodiver Dave Lindsey
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified