@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) private void withMissingRightJoin ( Table destination , List < Column < ? > > joinColumns , Table table2 ) { int t2StartCol = destination . columnCount ( ) - table2 . columnCount ( ) ; for ( int c = 0 ; c < destination . columnCount ( ) ; c ++ ) { boolean addedJoinColumns = false ; for ( Column joinColumn : joinColumns ) { if ( destination . column ( c ) . name ( ) . equalsIgnoreCase ( joinColumn . name ( ) ) ) { destination . column ( c ) . append ( joinColumn ) ; addedJoinColumns = true ; } } if ( ! addedJoinColumns ) { if ( c < t2StartCol ) { for ( int r2 = 0 ; r2 < table2 . rowCount ( ) ; r2 ++ ) { destination . column ( c ) . appendMissing ( ) ; } } else { Column t2Col = table2 . column ( c - t2StartCol ) ; destination . column ( c ) . append ( t2Col ) ; } } } }
Adds rows to destination for each row in the joinColumn and table2