hibernateConfigurationModel.addHibernateSessionFactory(sessionFactoryModel); Map<String, String> sessionFactoryProperties = new HashMap<>(); for (Element propElement : $(element).find("property"))
hibernateConfigurationModel.addHibernateSessionFactory(sessionFactoryModel); Map<String, String> sessionFactoryProperties = new HashMap<>(); for (Element propElement : $(element).find("property"))
private void createHibernateConfigurationModel(GraphContext graphContext, XmlFileModel xmlFileModel, String versionInformation) { HibernateConfigurationFileService hibernateConfigurationFileService = new HibernateConfigurationFileService(graphContext); GraphService<HibernateSessionFactoryModel> hibernateSessionFactoryService = new GraphService<>(graphContext, HibernateSessionFactoryModel.class); TechnologyTagService technologyTagService = new TechnologyTagService(graphContext); // check the root XML node. HibernateConfigurationFileModel hibernateConfigurationModel = hibernateConfigurationFileService.addTypeToModel(xmlFileModel); technologyTagService.addTagToFileModel(hibernateConfigurationModel, TECH_TAG, TECH_TAG_LEVEL); if (StringUtils.isNotBlank(versionInformation)) { hibernateConfigurationModel.setSpecificationVersion(versionInformation); } Document doc = new XmlFileService(graphContext).loadDocumentQuiet(xmlFileModel); for (Element element : $(doc).find("session-factory").get()) { HibernateSessionFactoryModel sessionFactoryModel = hibernateSessionFactoryService.create(); hibernateConfigurationModel.addHibernateSessionFactory(sessionFactoryModel); Map<String, String> sessionFactoryProperties = new HashMap<>(); for (Element propElement : $(element).find("property")) { String propKey = $(propElement).attr("name"); String propValue = $(propElement).text().trim(); sessionFactoryProperties.put(propKey, propValue); } sessionFactoryModel.setSessionFactoryProperties(sessionFactoryProperties); } }