Source:
public void readMappingFile(String mappingFile) { try { SAXBuilder saxBuilder = new SAXBuilder(); InputStream inputStream = getClass().getClassLoader().getResourceAsStream(mappingFile); if (inputStream == null) { LOG.error("Mapping file '{}' could not be found!", mappingFile); throw new IOException("Mapping file '" + mappingFile + "' could not be found!"); } Document document = saxBuilder.build(inputStream); if (document == null) { LOG.error("Mapping file '{}' could not be found!", mappingFile); throw new IOException("Mapping file '" + mappingFile + "' could not be found!"); } List<Element> classes = document.getRootElement().getChildren("class"); for (Element classElement : classes) { if (classElement.getAttributeValue("keyClass").equals( dataStore.getKeyClass().getCanonicalName()) && classElement.getAttributeValue("name").equals( dataStore.getPersistentClass().getCanonicalName())) { final String tableNameFromMapping = classElement.getAttributeValue("table"); String tableName = dataStore.getSchemaName(tableNameFromMapping, dataStore.getPersistentClass()); igniteMapping.setTableName(tableName); List<Element> prColumns = classElement.getChildren("primarykey"); List<Column> prFields = new ArrayList<>(); for (Element aPrimaryKey : prColumns) { String name = aPrimaryKey.getAttributeValue("column"); String type = aPrimaryKey.getAttributeValue("type"); prFields.add(new Column(name, Column.FieldType.valueOf(type))); } igniteMapping.setPrimaryKey(prFields); List<Element> fields = classElement.getChildren("field"); Map<String, Column> mp = new HashMap<>(); for (Element field : fields) { String fieldName = field.getAttributeValue("name"); String columnName = field.getAttributeValue("column"); String columnType = field.getAttributeValue("type"); mp.put(fieldName, new Column(columnName, Column.FieldType.valueOf(columnType))); } igniteMapping.setFields(mp); break; } } } catch (IOException | JDOMException | ConfigurationException e) { throw new RuntimeException(e); } LOG.info("Gora Ignite mapping file was read successfully."); }

Target:
public void readMappingFile(String mappingFile) { try { SAXBuilder saxBuilder = new SAXBuilder(); InputStream inputStream = getClass().getClassLoader().getResourceAsStream(mappingFile); if (inputStream == null) { LOG.error("Mapping file '{}' could not be found!", mappingFile); throw new IOException("Mapping file '" + mappingFile + "' could not be found!"); } Document document = saxBuilder.build(inputStream); if (document == null) { LOG.error("Mapping file '{}' could not be found!", mappingFile); throw new IOException("Mapping file '" + mappingFile + "' could not be found!"); } @SuppressWarnings("unchecked") List<Element> classes = document.getRootElement().getChildren("class"); for (Element classElement : classes) { if (classElement.getAttributeValue("keyClass").equals( dataStore.getKeyClass().getCanonicalName()) && classElement.getAttributeValue("name").equals( dataStore.getPersistentClass().getCanonicalName())) { final String tableNameFromMapping = classElement.getAttributeValue("table"); String tableName = dataStore.getSchemaName(tableNameFromMapping, dataStore.getPersistentClass()); igniteMapping.setTableName(tableName); @SuppressWarnings("unchecked") List<Element> prColumns = classElement.getChildren("primarykey"); List<Column> prFields = new ArrayList<>(); for (Element aPrimaryKey : prColumns) { String name = aPrimaryKey.getAttributeValue("column"); String type = aPrimaryKey.getAttributeValue("type"); prFields.add(new Column(name, Column.FieldType.valueOf(type))); } igniteMapping.setPrimaryKey(prFields); @SuppressWarnings("unchecked") List<Element> fields = classElement.getChildren("field"); Map<String, Column> mp = new HashMap<>(); for (Element field : fields) { String fieldName = field.getAttributeValue("name"); String columnName = field.getAttributeValue("column"); String columnType = field.getAttributeValue("type"); mp.put(fieldName, new Column(columnName, Column.FieldType.valueOf(columnType))); } igniteMapping.setFields(mp); break; } } } catch (IOException | JDOMException | ConfigurationException e) { throw new RuntimeException(e); } LOG.info("Gora Ignite mapping file was read successfully."); }