NullPointerException in JdbcModelReader.readTable (fix included)
----------------------------------------------------------------
Key: DDLUTILS-239
URL: https://issues.apache.org/jira/browse/DDLUTILS-239
Project: DdlUtils
Issue Type: Bug
Components: Core (No specific database)
Affects Versions: 1.0
Environment: Oracle 9i with nested tables
Reporter: Dave Lindsey
Assignee: Thomas Dudziak
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
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.