rename term initializer method
authorAndreas Müller <a.mueller@bgbm.org>
Fri, 1 Nov 2013 16:47:56 +0000 (16:47 +0000)
committerAndreas Müller <a.mueller@bgbm.org>
Fri, 1 Nov 2013 16:47:56 +0000 (16:47 +0000)
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/PersistentTermInitializer.java
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/database/TestingTermInitializer.java

index 2c60691535400c87fdb61cdc34cefe1389913b92..5dc112a8bd9f5ff582ae54436e84cdf21587829f 100644 (file)
@@ -109,7 +109,7 @@ public class PersistentTermInitializer extends DefaultTermInitializer {
             TransactionStatus txStatus = transactionManager.getTransaction(txDefinition);\r
            \r
             //new\r
-            //load uuids\r
+            //load uuids from csv files\r
             logger.info("Start new ... " );\r
             Map<UUID, Set<UUID>> uuidMap = new HashMap<UUID, Set<UUID>>();\r
             Map<UUID, VocabularyEnum> vocTypeMap = new HashMap<UUID, VocabularyEnum>();\r
@@ -146,7 +146,7 @@ public class PersistentTermInitializer extends DefaultTermInitializer {
                                vocabularyDao.saveOrUpdate(voc);\r
                        }\r
                    }\r
-                   secondPass(vocabularyType.getClazz(),vocUuid, terms, vocabularyMap);  //TODO \r
+                   initializeAndStore(vocabularyType.getClazz(),vocUuid, terms, vocabularyMap);  //TODO \r
                }\r
                    \r
             //load all persisted vocabularies\r
@@ -183,7 +183,7 @@ public class PersistentTermInitializer extends DefaultTermInitializer {
      *                                                  loaded terms with their <code>UUID</code> as key\r
      * @param vocabularyMap \r
      */\r
-    protected void secondPass(Class clazz, UUID vocabularyUuid, Map<UUID,DefinedTermBase> terms, Map<UUID, TermVocabulary<?>> vocabularyMap) {\r
+    protected void initializeAndStore(Class clazz, UUID vocabularyUuid, Map<UUID,DefinedTermBase> terms, Map<UUID, TermVocabulary<?>> vocabularyMap) {\r
         logger.debug("Loading vocabulary for class " + clazz.getSimpleName() + " with uuid " + vocabularyUuid );\r
 \r
         TermVocabulary<?> persistedVocabulary;\r
@@ -195,6 +195,7 @@ public class PersistentTermInitializer extends DefaultTermInitializer {
         \r
         \r
         logger.debug("Initializing terms in vocabulary for class " + clazz.getSimpleName() + " with uuid " + vocabularyUuid );\r
+        //not really needed anymore as we do term initializing from the beginning now\r
         if (persistedVocabulary != null){\r
             for(Object object : persistedVocabulary.getTerms()) {\r
                 DefinedTermBase<?> definedTermBase = (DefinedTermBase) object;\r
index ab2a2099bcd7e2369986be4c2bc4e6bd69a5a525..e5fd87994856f2f02dd72831a2dbc9361e55806a 100644 (file)
@@ -121,7 +121,7 @@ public class TestingTermInitializer extends PersistentTermInitializer {
             for(VocabularyEnum vocabularyType : VocabularyEnum.values()) {\r
                 Class<? extends DefinedTermBase<?>> clazz = vocabularyType.getClazz();\r
                 UUID vocabularyUuid = vocabularyType.getUuid();\r
-                secondPass(clazz, vocabularyUuid,new HashMap<UUID,DefinedTermBase>(), null);\r
+                initializeAndStore(clazz, vocabularyUuid,new HashMap<UUID,DefinedTermBase>(), null);\r
             }\r
             transactionManager.commit(txStatus);\r
             //txStatus = transactionManager.getTransaction(txDefinition);\r