public class ReflectionMapperUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
anyColumnsStartWithPrefix(Collection<String> columnNames,
String prefix,
List<ColumnNameMatcher> columnNameMatchers)
Returns whether any of the given column names begin with the given prefix, according to the list of column name
matchers.
|
static OptionalInt |
findColumnIndex(String paramName,
List<String> columnNames,
List<ColumnNameMatcher> columnNameMatchers,
Supplier<String> debugName)
Attempts to find the index of a specified column's mapped parameter in a list of column names
|
static List<String> |
getColumnNames(ResultSet rs)
Returns the name of all the columns present in the specified
ResultSet |
public static boolean anyColumnsStartWithPrefix(Collection<String> columnNames, String prefix, List<ColumnNameMatcher> columnNameMatchers)
columnNames - the column names to searchprefix - the prefix to search forcolumnNameMatchers - list of column name matcherspublic static OptionalInt findColumnIndex(String paramName, List<String> columnNames, List<ColumnNameMatcher> columnNameMatchers, Supplier<String> debugName)
paramName - the name of the parameter to search forcolumnNames - list of column names to search incolumnNameMatchers - ColumnNameMatchers to map paramName to the column namesdebugName - name of the parameter to use for debugging purposes (ie: when throwing exceptions)OptionalInt with the found index, OptionalInt.empty() otherwise.public static List<String> getColumnNames(ResultSet rs) throws SQLException
ResultSetrs - the ResultSet to get the column names ofrs (will contain duplicates if multiple columns have the same name)SQLException - See ResultSet.getMetaData(), ResultSetMetaData.getColumnCount(),
and ResultSetMetaData.getColumnLabel(int)Copyright © 2019. All rights reserved.