public Map<String, InverseForeignKeyData> getExportedKeys(DatabaseMetaData md,
            String catalog, String schema, String tableName) throws SQLException {
        try (ResultSet foreignKeys = md.getExportedKeys(catalog, schema, tableName)) {
            Map<String, InverseForeignKeyData> inverseForeignKeyData = new TreeMap<String, InverseForeignKeyData>();
            while (foreignKeys.next()) {
                String name = foreignKeys.getString(FK_NAME);
                String parentColumnName = namingStrategy.normalizeColumnName(foreignKeys.getString(FK_PARENT_COLUMN_NAME));
                String foreignSchemaName = namingStrategy.normalizeSchemaName(foreignKeys.getString(FK_FOREIGN_SCHEMA_NAME));
                String foreignTableName = namingStrategy.normalizeTableName(foreignKeys.getString(FK_FOREIGN_TABLE_NAME));
                String foreignColumn = namingStrategy.normalizeColumnName(foreignKeys.getString(FK_FOREIGN_COLUMN_NAME));
                if (name == null || name.isEmpty()) {
                    name = tableName + "_" + foreignTableName + "_IFK";
                }

                InverseForeignKeyData data = inverseForeignKeyData.get(name);
                if (data == null) {
                    data = new InverseForeignKeyData(name, foreignSchemaName,
                            foreignTableName, createType(foreignSchemaName, foreignTableName));
                    inverseForeignKeyData.put(name, data);
                }
                data.add(parentColumnName, foreignColumn);
            }
            return inverseForeignKeyData;
        }
    }
{@code KeyDataFactory} is a factory for table key data

@author tiwe
querydsl-sql-codegen/src/main/java/com/querydsl/sql/codegen/KeyDataFactory.java