private BaseTable getPhysicalTable ( PassThruTable table , Record record ) { BaseTable altTable = table . getNextTable ( ) ; if ( altTable instanceof PassThruTable ) { BaseTable physicalTable = getPhysicalTable ( ( PassThruTable ) altTable , record ) ; if ( physicalTable != null ) if ( physicalTable != altTable ) return physicalTable ; } else if ( altTable . getDatabase ( ) . getDatabaseName ( true ) . equals ( record . getTable ( ) . getDatabase ( ) . getDatabaseName ( true ) ) ) return altTable ; Iterator < BaseTable > tables = table . getTables ( ) ; while ( tables . hasNext ( ) ) { altTable = tables . next ( ) ; if ( altTable instanceof PassThruTable ) { BaseTable physicalTable = getPhysicalTable ( ( PassThruTable ) altTable , record ) ; if ( physicalTable != null ) if ( physicalTable != altTable ) return physicalTable ; } else if ( altTable . getDatabase ( ) . getDatabaseName ( true ) . equals ( record . getTable ( ) . getDatabase ( ) . getDatabaseName ( true ) ) ) return altTable ; } return table ; }
Dig down and get the physical table for this record .