private ITableMetaData mergeTableMetaData ( List < Column > columnsToMerge , ITableMetaData originalMetaData ) throws DataSetException { Column [ ] columns = new Column [ originalMetaData . getColumns ( ) . length + columnsToMerge . size ( ) ] ; System . arraycopy ( originalMetaData . getColumns ( ) , 0 , columns , 0 , originalMetaData . getColumns ( ) . length ) ; for ( int i = 0 ; i < columnsToMerge . size ( ) ; i ++ ) { Column column = columnsToMerge . get ( i ) ; columns [ columns . length - columnsToMerge . size ( ) + i ] = column ; } return new DefaultTableMetaData ( originalMetaData . getTableName ( ) , columns ) ; }
merges the existing columns with the potentially new ones .