Modifier and Type | Class and Description |
---|---|
static class |
Columns.ColumnDiff
Describes the
Column s that are different in two tables. |
Modifier and Type | Method and Description |
---|---|
static Column[] |
findColumnsByName(Column[] columns,
ITableMetaData tableMetaData)
|
static Column[] |
findColumnsByName(String[] columnNames,
ITableMetaData tableMetaData)
|
static Column |
getColumn(String columnName,
Column[] columns)
Search and return the specified column from the specified column array.
|
static Columns.ColumnDiff |
getColumnDiff(ITableMetaData expectedMetaData,
ITableMetaData actualMetaData)
Returns the column difference of the two given
ITableMetaData objects |
static String[] |
getColumnNames(Column[] columns)
Returns the names of the given column objects as string array
|
static String |
getColumnNamesAsString(Column[] columns)
Creates a pretty string representation of the given column names
|
static Column[] |
getColumns(String[] columnNames,
Column[] columns)
Search and return the
Column s from the specified column array that
match one of the given columnNames . |
static Column[] |
getColumns(String tableName,
Column[] columns,
IColumnFilter columnFilter)
Search and return the columns from the specified column array which are
accepted by the given
IColumnFilter . |
static Column |
getColumnValidated(String columnName,
Column[] columns,
String tableName)
Search and return the specified column from the specified column array.
|
static Column[] |
getSortedColumns(ITableMetaData metaData)
Returns a sorted array of column objects
|
static Column[] |
mergeColumnsByName(Column[] referenceColumns,
Column[] columnsToMerge)
Merges the two arrays of columns so that all of the columns are available in the result array.
|
public static Column[] getColumns(String[] columnNames, Column[] columns)
Column
s from the specified column array that
match one of the given columnNames
.
findColumnsByName(String[], ITableMetaData)
because it iterates over all columns.columnNames
- the names of the columns to search.columns
- the array of columns in which the columnNames
will be searched.findColumnsByName(String[], ITableMetaData)
public static Column[] findColumnsByName(String[] columnNames, ITableMetaData tableMetaData) throws NoSuchColumnException, DataSetException
columnNames
- The column names that are searched in the given table metadatatableMetaData
- The table metadata in which the columns are searched by nametableMetaData
NoSuchColumnException
- if the given column has not been foundDataSetException
- if something goes wrong when trying to retrieve the columnspublic static Column[] findColumnsByName(Column[] columns, ITableMetaData tableMetaData) throws NoSuchColumnException, DataSetException
columns
- The columns whose names are searched in the given table metadatatableMetaData
- The table metadata in which the columns are searched by nametableMetaData
NoSuchColumnException
- if the given column has not been foundDataSetException
- if something goes wrong when trying to retrieve the columnspublic static Column getColumn(String columnName, Column[] columns)
ITableMetaData.getColumnIndex(String)
because it iterates over all columns.columnName
- the name of the column to search.columns
- the array of columns in which the columnName
will be searched.null
if the column is not foundpublic static Column getColumnValidated(String columnName, Column[] columns, String tableName) throws NoSuchColumnException
columnName
- the name of the column to search.columns
- the array of columns in which the columnName
will be searched.tableName
- The name of the table to which the column array belongs -
only needed for the exception message in case of a validation failureNoSuchColumnException
- If no column exists with the given namepublic static Column[] getColumns(String tableName, Column[] columns, IColumnFilter columnFilter)
IColumnFilter
.tableName
- The name of the table which is needed for the filter invocationcolumns
- All available columns to which the filter will be appliedcolumnFilter
- The column filter that is applied to the given columns
public static Column[] getSortedColumns(ITableMetaData metaData) throws DataSetException
metaData
- The metaData needed to get the columns to be sortedDataSetException
public static String[] getColumnNames(Column[] columns)
columns
- The column objectspublic static String getColumnNamesAsString(Column[] columns)
columns
- The columns to be formattedpublic static Column[] mergeColumnsByName(Column[] referenceColumns, Column[] columnsToMerge)
referenceColumns
- reference columns treated as master columns during the mergecolumnsToMerge
- potentially new columns to be merged if they do not yet exist in the referenceColumnspublic static Columns.ColumnDiff getColumnDiff(ITableMetaData expectedMetaData, ITableMetaData actualMetaData) throws DataSetException
ITableMetaData
objectsexpectedMetaData
- actualMetaData
- ITableMetaData
objectsDataSetException
Copyright © 2002–2024. All rights reserved.