+ }\r
+ //invokeRelations(source, cdmApp, deleteAll, taxonMap, referenceMap);\r
+ logger.info("saving taxa ...");\r
+ taxonService.saveTaxonAll(taxonMap.objects());\r
+ \r
+ logger.info("end makeTaxa ...");\r
+ \r
+ return true;\r
+ } catch (SQLException e) {\r
+ logger.error("SQLException:" + e);\r
+ return false;\r
+ }\r
+\r
+ }\r
+ \r
+\r
+ public static boolean invokeRelations(BerlinModelImportConfigurator bmiConfig, CdmApplicationController cdmApp, \r
+ MapWrapper<TaxonBase> taxonMap, MapWrapper<ReferenceBase> referenceMap){\r
+\r
+ Set<TaxonBase> taxonStore = new HashSet<TaxonBase>();\r
+ Source source = bmiConfig.getSource();\r
+ String dbAttrName;\r
+ String cdmAttrName;\r
+ \r
+ logger.info("start makeTaxonRelationships ...");\r
+ \r
+ ITaxonService taxonService = cdmApp.getTaxonService();\r
+ boolean delete = bmiConfig.isDeleteAll();\r
+\r
+ try {\r
+ //get data from database\r
+ String strQuery = \r
+ " SELECT RelPTaxon.*, FromTaxon.RIdentifier as taxon1Id, ToTaxon.RIdentifier as taxon2Id " + \r
+ " FROM PTaxon as FromTaxon INNER JOIN " +\r
+ " RelPTaxon ON FromTaxon.PTNameFk = RelPTaxon.PTNameFk1 AND FromTaxon.PTRefFk = RelPTaxon.PTRefFk1 INNER JOIN " +\r
+ " PTaxon AS ToTaxon ON RelPTaxon.PTNameFk2 = ToTaxon.PTNameFk AND RelPTaxon.PTRefFk2 = ToTaxon.PTRefFk "+\r
+ " WHERE (1=1)";\r
+ ResultSet rs = source.getResultSet(strQuery) ;\r
+ \r
+ int i = 0;\r
+ //for each reference\r
+ while (rs.next()){\r
+ \r
+ if ((i++ % modCount) == 0){ logger.info("RelPTaxa handled: " + (i-1));}\r
+ \r
+ int relPTaxonId = rs.getInt("RelPTaxonId");\r
+ int taxon1Id = rs.getInt("taxon1Id");\r
+ int taxon2Id = rs.getInt("taxon2Id");\r
+ int relRefFk = rs.getInt("relRefFk");\r
+ int relQualifierFk = rs.getInt("relQualifierFk");\r