oscaroox / power-architect

Automatically exported from code.google.com/p/power-architect
GNU General Public License v3.0
0 stars 0 forks source link

java.lang.IllegalArgumentException while trying to drop table ( OE.Action_Table) into PlayPen #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Launch test_environment database
2. explore OE schema
3. select & drop ACTION_TABLE

it draw Action_Table into playpen with following error message.

java.lang.IllegalArgumentException: Table ACTION_TABLE is not in this rowset
    at ca.sqlpower.sql.jdbcwrapper.IndexedCachedRowSet.extractSingleTable(IndexedCachedRowSet.java:87)
    at ca.sqlpower.sql.jdbcwrapper.OracleDatabaseMetaDataDecorator.getColumns(OracleDatabaseMetaDataDecorator.java:661)
    at ca.sqlpower.sqlobject.SQLColumn.fetchColumnsForTable(SQLColumn.java:482)
    at ca.sqlpower.sqlobject.SQLTable.populateAllColumns(SQLTable.java:407)
    at ca.sqlpower.sqlobject.SQLTable.populateColumns(SQLTable.java:365)
    at ca.sqlpower.sqlobject.SQLTable.populateImpl(SQLTable.java:1335)
    at ca.sqlpower.sqlobject.SQLObject.populate(SQLObject.java:186)
    at ca.sqlpower.sqlobject.SQLTable.getChildren(SQLTable.java:1963)
    at ca.sqlpower.sqlobject.SQLObject.getChildren(SQLObject.java:285)
    at ca.sqlpower.architect.swingui.PlayPen$AddObjectsTask.ensurePopulated(PlayPen.java:1577)
    at ca.sqlpower.architect.swingui.PlayPen$AddObjectsTask.doStuff(PlayPen.java:1552)
    at ca.sqlpower.swingui.SPSwingWorker.run(SPSwingWorker.java:104)
    at java.lang.Thread.run(Thread.java:680)

Please use labels and text to provide additional information.

Original issue reported on code.google.com by ki...@sqlpower.ca on 16 May 2013 at 9:03

GoogleCodeExporter commented 8 years ago
This error occurred because selected table doesn't have all_tab_columns. In 
ca.sqlpower.sql.jdbcwrapperOracleDatabaseMetaData:: getColumns() sql statement 
trying to select all table columns, but as the table doesn't have tab_column it 
return nothing.

I have tried to execute following sql command in DBVisualizer using same 
database(test_environment) > schema (OE) .Table (ACTION_TABLE)
SELECT column_name, data_type from all_table_cols where table_name = 
'ACTION_TABLE'

Generate error:  14:03:54  [SELECT - 0 row(s), 0.000 secs]  [Error Code: 942, 
SQL State: 42000]  ORA-00942: table or view does not exist
... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 
sec [0 successful, 0 warnings, 1 errors]

Instead if I execute :
SELECT column_name, data_type from all_nested_table_cols where table_name = 
'ACTION_TABLE'

Result:
COLUMN_NAME                  DATA_TYPE
=========================
SYS_XDBPD$                          XDB$RAW_LIST_T
SYS_NC_ROWINFO$         ACTION_T
SYS_NC_ARRAY_INDEX$ NUMBER
NESTED_TABLE_ID         RAW
DATE_ACTIONED                   DATE
ACTIONED_BY                 VARCHAR2

To fix this issue, I think it need to modify sql stmt in 
ca.sqlpower.sql.jdbcwrapperOracleDatabaseMetaData:: getColumns() 
which will also able be to select all_nested_table_cols of the table.

Original comment by ki...@sqlpower.ca on 30 May 2013 at 6:22