public Map<String, ForeignKeyData> getImportedKeys(DatabaseMetaData md,
            String catalog, String schema, String tableName) throws SQLException {
        try (ResultSet foreignKeys = md.getImportedKeys(catalog, schema, tableName)) {
            Map<String, ForeignKeyData> foreignKeyData = new TreeMap<String, ForeignKeyData>();
            while (foreignKeys.next()) {
                String name = foreignKeys.getString(FK_NAME);
                String parentSchemaName = namingStrategy.normalizeSchemaName(foreignKeys.getString(FK_PARENT_SCHEMA_NAME));
                String parentTableName = namingStrategy.normalizeTableName(foreignKeys.getString(FK_PARENT_TABLE_NAME));
                String parentColumnName = namingStrategy.normalizeColumnName(foreignKeys.getString(FK_PARENT_COLUMN_NAME));
                String foreignColumn = namingStrategy.normalizeColumnName(foreignKeys.getString(FK_FOREIGN_COLUMN_NAME));
                if (name == null || name.isEmpty()) {
                    name = tableName + "_" + parentTableName + "_FK";
                }

                ForeignKeyData data = foreignKeyData.get(name);
                if (data == null) {
                    data = new ForeignKeyData(name, parentSchemaName, parentTableName,
                            createType(parentSchemaName, parentTableName));
                    foreignKeyData.put(name, data);
                }
                data.add(foreignColumn, parentColumnName);
            }
            return foreignKeyData;
        }
    }
{@code KeyDataFactory} is a factory for table key data

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