private void mapColumnNameMatches(final Table table) { for (final Column column: table.getColumns()) { String matchColumnName = column.getName().toLowerCase(); if (matchColumnName.endsWith("_id")) { matchColumnName = matchColumnName .substring(0, matchColumnName.length() - 3); } if (matchColumnName.endsWith("id") && !matchColumnName.equals("id")) { matchColumnName = matchColumnName .substring(0, matchColumnName.length() - 2); } if (!matchColumnName.equals("id")) { columnsForMatchKey.add(matchColumnName, column); matchKeysForColumn.add(column, matchColumnName); } } }
private void mapTableNameMatches(final List<Table> tables, final Collection<String> prefixes) { for (final Table table: tables) { for (final String prefix: prefixes) { String matchTableName = table.getName().toLowerCase(); if (matchTableName.startsWith(prefix)) { matchTableName = matchTableName.substring(prefix.length()); matchTableName = Inflection.singularize(matchTableName); if (!isBlank(matchTableName)) { tableKeys.add(table, matchTableName); } } } } }
private void mapColumnNameMatches(final Table table) { for (final Column column: table.getColumns()) { String matchColumnName = column.getName().toLowerCase(); if (matchColumnName.endsWith("_id")) { matchColumnName = matchColumnName .substring(0, matchColumnName.length() - 3); } if (matchColumnName.endsWith("id") && !matchColumnName.equals("id")) { matchColumnName = matchColumnName .substring(0, matchColumnName.length() - 2); } if (!matchColumnName.equals("id")) { columnsForMatchKey.add(matchColumnName, column); matchKeysForColumn.add(column, matchColumnName); } } }
private void mapColumnNameMatches(final Table table) { for (final Column column: table.getColumns()) { String matchColumnName = column.getName().toLowerCase(); if (matchColumnName.endsWith("_id")) { matchColumnName = matchColumnName .substring(0, matchColumnName.length() - 3); } if (matchColumnName.endsWith("id") && !matchColumnName.equals("id")) { matchColumnName = matchColumnName .substring(0, matchColumnName.length() - 2); } if (!matchColumnName.equals("id")) { columnsForMatchKey.add(matchColumnName, column); matchKeysForColumn.add(column, matchColumnName); } } }
private void mapTableNameMatches(final List<Table> tables, final Collection<String> prefixes) { for (final Table table: tables) { for (final String prefix: prefixes) { String matchTableName = table.getName().toLowerCase(); if (matchTableName.startsWith(prefix)) { matchTableName = matchTableName.substring(prefix.length()); matchTableName = Inflection.singularize(matchTableName); if (!isBlank(matchTableName)) { tableKeys.add(table, matchTableName); } } } } }
private void mapTableNameMatches(final List<Table> tables, final Collection<String> prefixes) { for (final Table table: tables) { for (final String prefix: prefixes) { String matchTableName = table.getName().toLowerCase(); if (matchTableName.startsWith(prefix)) { matchTableName = matchTableName.substring(prefix.length()); matchTableName = Inflection.singularize(matchTableName); if (!isBlank(matchTableName)) { tableKeys.add(table, matchTableName); } } } } }
private Multimap<String, Table> mapTableNameMatches(final List<Table> tables, final Collection<String> prefixes) { final Multimap<String, Table> matchMap = new Multimap<>(); for (final Table table: tables) { for (final String prefix: prefixes) { String matchTableName = table.getName().toLowerCase(); if (matchTableName.startsWith(prefix)) { matchTableName = matchTableName.substring(prefix.length()); matchTableName = Inflection.singularize(matchTableName); matchMap.add(matchTableName, table); } } } matchMap.remove(""); return matchMap; }