+ // PresenceTerm => all
+ stepName = "Update idInVocabulary for PresenceTerm";
+ uuid = "adbbbe15-c4d3-47b7-80a8-c7d104e53a05";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName,
+ String.format(queryVocUuid, uuid), 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // AbsenceTerm => all
+ stepName = "Update idInVocabulary for AbsenceTerm";
+ uuid = "5cd438c8-a8a1-4958-842e-169e83e2ceee";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName,
+ String.format(queryVocUuid, uuid), 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // Sex => all
+ stepName = "Update idInVocabulary for Sex";
+ uuid = "9718b7dd-8bc0-4cad-be57-3c54d4d432fe";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName,
+ String.format(queryVocUuid, uuid), 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // ExtensionType => all
+ stepName = "Update idInVocabulary for ExtensionType";
+ uuid = "117cc307-5bd4-4b10-9b2f-2e14051b3b20";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName,
+ String.format(queryVocUuid, uuid), 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // ReferenceSystem => all
+ stepName = "Update idInVocabulary for ReferenceSystem";
+ uuid = "ec6376e5-0c9c-4f5c-848b-b288e6c17a86";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName,
+ String.format(queryVocUuid, uuid), 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // DeterminationModifier => all
+ stepName = "Update idInVocabulary for DeterminationModifier";
+ uuid = "fe87ea8d-6e0a-4e5d-b0da-0ab8ea67ca77";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName,
+ String.format(queryVocUuid, uuid), 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // InstitutionType, MeasurementUnit, Scope, Stage, State, TextFormat,
+ // Modifier, PreservationMethod => dummies
+ stepName = "Update idInVocabulary for dummy terms in several vocabularies";
+ query = " UPDATE @@DefinedTermBase@@ "
+ + " SET idInVocabulary = (SELECT abbreviatedlabel "
+ + " FROM @@DefinedTermBase_Representation@@ MN "
+ + " INNER JOIN @@Representation@@ r ON r.id = MN.representations_id "
+ + " WHERE MN.DefinedTermBase_id = @@DefinedTermBase@@.id) "
+ + " WHERE termType IN ('%s','%s','%s','%s','%s','%s','%s','%s')";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(
+ stepName,
+ String.format(query, TermType.InstitutionType.getKey(),
+ TermType.MeasurementUnit.getKey(),
+ TermType.Scope.getKey(), TermType.Stage.getKey(),
+ TermType.State.getKey(), TermType.TextFormat.getKey(),
+ TermType.Modifier.getKey(), TermType.Method.getKey()), 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ stepName = "Update idInVocabulary for dummy state";
+ query = " UPDATE @@DefinedTermBase@@ "
+ + " SET idinvocabulary = 'std' "
+ + " WHERE uuid = '881b9c80-626d-47a6-b308-a63ee5f4178f' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99);
+ stepList.add(step);
+
+ stepName = "Update idInVocabulary for dummy stage";
+ query = " UPDATE @@DefinedTermBase@@ "
+ + " SET idinvocabulary = 'sgd' "
+ + " WHERE uuid = '48f8e8a7-a2ac-4974-9ce8-6944afc5095e' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99);
+ stepList.add(step);
+
+ stepName = "Update idInVocabulary for dummy modifier";
+ query = " UPDATE @@DefinedTermBase@@ "
+ + " SET idinvocabulary = 'md' "
+ + " WHERE uuid = 'efc38dad-205c-4028-ad9d-ae509a14b37a' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99);
+ stepList.add(step);
+
+ // Remove state dummy
+ stepName = "Remove state dummy if possible";
+ uuid = "881b9c80-626d-47a6-b308-a63ee5f4178f";
+ String checkUsed = " SELECT count(*) as n FROM @@StateData@@ sd "
+ + " WHERE sd.state_id = %d ";
+ step = SingleTermRemover.NewInstance(stepName, uuid, checkUsed, 99);
+ stepList.add(step);
+
+ // Remove institution type dummy
+ stepName = "Remove institution type dummy term";
+ uuid = "bea94a6c-472b-421c-abc1-52f797c51dbf";
+ checkUsed = " SELECT count(*) as n FROM @@AgentBase_DefinedTermBase@@ MN "
+ + " WHERE MN.types_id = %d ";
+ step = SingleTermRemover.NewInstance(stepName, uuid, checkUsed, 99);
+ stepList.add(step);
+
+ // Remove measurement unit dummy
+ stepName = "Remove measurement unit dummy term";
+ uuid = "e19dd590-5be8-4c93-978f-b78554116289";
+ checkUsed = " SELECT count(*) as n FROM @@DescriptionElementBase@@ deb "
+ + " WHERE deb.unit_id = %d ";
+ step = SingleTermRemover.NewInstance(stepName, uuid, checkUsed, 99);
+ stepList.add(step);
+
+ // Remove scope dummy
+ stepName = "Remove scope dummy term";
+ uuid = "2ace7f1f-4ce6-47e1-8a65-e3f6b724876c";
+ checkUsed = " SELECT count(*) as n FROM @@DescriptionBase_Scope@@ MN "
+ + " WHERE MN.scopes_id = %d ";
+ step = SingleTermRemover.NewInstance(stepName, uuid, checkUsed, 99);
+ stepList.add(step);
+
+ // Remove stage dummy
+ stepName = "Remove stage dummy term";
+ uuid = "48f8e8a7-a2ac-4974-9ce8-6944afc5095e";
+ checkUsed = " SELECT count(*) as n FROM @@DescriptionBase_Scope@@ MN "
+ + " WHERE MN.scopes_id = %d ";
+ String checkUsed2 = " SELECT count(*) as n FROM @@SpecimenOrObservationBase@@ osb "
+ + " WHERE osb.lifestage_id = %d ";
+ step = SingleTermRemover.NewInstance(stepName, uuid, checkUsed, 99)
+ .addCheckUsedQuery(checkUsed2, 99);
+ stepList.add(step);
+
+ // Remove text format dummy
+ stepName = "Remove text format dummy if possible";
+ uuid = "5d095782-d99c-46bc-a158-edb2e47c9b63";
+ checkUsed = " SELECT count(*) as n FROM @@DescriptionElementBase@@ deb "
+ + " WHERE deb.format_id = %d ";
+ step = SingleTermRemover.NewInstance(stepName, uuid, checkUsed, 99);
+ stepList.add(step);
+
+ // Remove modifier dummy
+ stepName = "Remove modifier dummy if possible";
+ uuid = "efc38dad-205c-4028-ad9d-ae509a14b37a";
+ checkUsed = " SELECT count(*) as n FROM @@DescriptionElementBase_Modifier@@ MN "
+ + " WHERE MN.modifiers_id = %d ";
+ checkUsed2 = " SELECT count(*) as n FROM @@StateData_DefinedTermBase@@ MN "
+ + " WHERE MN.modifiers_id = %d ";
+ String checkUsed3 = " SELECT count(*) as n FROM @@StatisticalMeasurementValue_DefinedTermBase@@ MN "
+ + " WHERE MN.modifiers_id = %d ";
+ step = SingleTermRemover.NewInstance(stepName, uuid, checkUsed, 99)
+ .addCheckUsedQuery(checkUsed2, 99).addCheckUsedQuery(checkUsed3, 99);
+ stepList.add(step);
+
+ // Remove text preservation method dummy
+ stepName = "Remove preservation method dummy if possible";
+ uuid = "3edc2633-365b-4a9b-bc3a-f3f85f59dbdf";
+ checkUsed = " SELECT count(*) as n FROM @@SpecimenOrObservationBase@@ osb "
+ + " WHERE osb.preservation_id = %d ";
+ step = SingleTermRemover.NewInstance(stepName, uuid, checkUsed, 99);
+ stepList.add(step);
+
+ // Split Country Vocabulary #3700
+ stepName = "Create Waterbody vocabulary";
+ UUID uuidVocabulary = UUID
+ .fromString("35a62b25-f541-4f12-a7c7-17d90dec3e03");
+ String description = "Major Waterbodies of the World";
+ String label = "Waterbody";
+ String abbrev = null;
+ boolean isOrdered = false;
+ TermType termType = TermType.NamedArea;
+ Class<?> termClass = NamedArea.class;
+ step = VocabularyCreator.NewVocabularyInstance(uuidVocabulary,
+ description, label, abbrev, isOrdered, termClass, termType);
+ stepList.add(step);
+
+ stepName = "Move waterbodies to new vocabulary";
+ UUID newVocabulary = UUID.fromString("35a62b25-f541-4f12-a7c7-17d90dec3e03");
+ step = TermMover
+ .NewInstance(stepName, newVocabulary,
+ "aa96ca19-46ab-6365-af29-e4842f13eb4c")
+ .addTermUuid(UUID.fromString("36aea55c-46ab-6365-af29-e4842f13eb4c"))
+ .addTermUuid(UUID.fromString("36aea55c-892c-6365-af29-e4842f13eb4c"))
+ .addTermUuid(UUID.fromString("36aea55c-892c-4114-af29-d4b287f76fab"))
+ .addTermUuid(UUID.fromString("aa96ca19-892c-4114-af29-d4b287f76fab"))
+ .addTermUuid(UUID.fromString("aa96ca19-892c-4114-a494-d4b287f76fab"))
+ .addTermUuid(UUID.fromString("d4cf6c57-892c-4114-bf57-96886eb7108a"))
+ .addTermUuid(UUID.fromString("d4cf6c57-892c-c953-a494-96886eb7108a"))
+ .addTermUuid(UUID.fromString("aa96ca19-46ab-c953-a494-96886eb7108a"))
+ .addTermUuid(UUID.fromString("aa96ca19-46ab-4114-a494-96886eb7108a"));
+ stepList.add(step);
+
+ // update waterbody uuids #3705 AND waterbody DTYPE to NamedArea and
+ // sortindex new #3700
+ stepName = "Update waterbody uuids";
+ sql = " UPDATE @@DefinedTermBase@@ SET DTYPE = 'NamedArea', orderindex = 1, uuid = 'af4271e5-8897-4e6f-9db7-54ea4f28cfc0' WHERE uuid = 'aa96ca19-46ab-6365-af29-e4842f13eb4c' ";
+ step = SimpleSchemaUpdaterStep.NewAuditedInstance(stepName, sql, "DefinedTermBase", 99);
+ stepList.add(step);
+ sql = " UPDATE @@DefinedTermBase@@ SET DTYPE = 'NamedArea', orderindex = 2, uuid = '77e79804-1b17-4c99-873b-933fe216e3da' WHERE uuid = '36aea55c-46ab-6365-af29-e4842f13eb4c' ";
+ step = SimpleSchemaUpdaterStep.NewAuditedInstance(stepName, sql,
+ "DefinedTermBase", 99);
+ stepList.add(step);
+ sql = " UPDATE @@DefinedTermBase@@ SET DTYPE = 'NamedArea', orderindex = 3, uuid = '3d68a327-104c-49d5-a2d8-c71c6600181b' WHERE uuid = '36aea55c-892c-6365-af29-e4842f13eb4c' ";
+ step = SimpleSchemaUpdaterStep.NewAuditedInstance(stepName, sql,
+ "DefinedTermBase", 99);
+ stepList.add(step);
+ sql = " UPDATE @@DefinedTermBase@@ SET DTYPE = 'NamedArea', orderindex = 4, uuid = 'ff744a37-5990-462c-9c20-1e85a9943851' WHERE uuid = '36aea55c-892c-4114-af29-d4b287f76fab' ";
+ step = SimpleSchemaUpdaterStep.NewAuditedInstance(stepName, sql,
+ "DefinedTermBase", 99);
+ stepList.add(step);
+ sql = " UPDATE @@DefinedTermBase@@ SET DTYPE = 'NamedArea', orderindex = 5, uuid = 'ef04f363-f67f-4a2c-8d98-110de4c5f654' WHERE uuid = 'aa96ca19-892c-4114-af29-d4b287f76fab' ";
+ step = SimpleSchemaUpdaterStep.NewAuditedInstance(stepName, sql,
+ "DefinedTermBase", 99);
+ stepList.add(step);
+ sql = " UPDATE @@DefinedTermBase@@ SET DTYPE = 'NamedArea', orderindex = 6, uuid = '8811a47e-29d6-4455-8f83-8916b78a692f' WHERE uuid = 'aa96ca19-892c-4114-a494-d4b287f76fab' ";
+ step = SimpleSchemaUpdaterStep.NewAuditedInstance(stepName, sql,
+ "DefinedTermBase", 99);
+ stepList.add(step);
+ sql = " UPDATE @@DefinedTermBase@@ SET DTYPE = 'NamedArea', orderindex = 7, uuid = '4cb4bbae-9aab-426c-9025-e34f809165af' WHERE uuid = 'd4cf6c57-892c-4114-bf57-96886eb7108a' ";
+ step = SimpleSchemaUpdaterStep.NewAuditedInstance(stepName, sql,
+ "DefinedTermBase", 99);
+ stepList.add(step);
+ sql = " UPDATE @@DefinedTermBase@@ SET DTYPE = 'NamedArea', orderindex = 8, uuid = '598fec0e-b93a-4947-a1f3-601e380797f7' WHERE uuid = 'd4cf6c57-892c-c953-a494-96886eb7108a' ";
+ step = SimpleSchemaUpdaterStep.NewAuditedInstance(stepName, sql,
+ "DefinedTermBase", 99);
+ stepList.add(step);
+ sql = " UPDATE @@DefinedTermBase@@ SET DTYPE = 'NamedArea', orderindex = 9, uuid = 'ee69385e-6c80-405c-be6e-974e9fd1e297' WHERE uuid = 'aa96ca19-46ab-c953-a494-96886eb7108a' ";
+ step = SimpleSchemaUpdaterStep.NewAuditedInstance(stepName, sql,
+ "DefinedTermBase", 99);
+ stepList.add(step);
+ sql = " UPDATE @@DefinedTermBase@@ SET DTYPE = 'NamedArea', orderindex = 10, uuid = '8dc16e70-74b8-4143-95cf-a659a319a854' WHERE uuid = 'aa96ca19-46ab-4114-a494-96886eb7108a' ";
+ step = SimpleSchemaUpdaterStep.NewAuditedInstance(stepName, sql,
+ "DefinedTermBase", 99);
+ stepList.add(step);
+
+ // update DTYPE for country
+ stepName = "Update DTYPE for Countries";
+ sql = " UPDATE @@DefinedTermBase@@ SET DTYPE = 'Country' WHERE DTYPE = 'WaterbodyOrCountry' ";
+ step = SimpleSchemaUpdaterStep.NewAuditedInstance(stepName, sql,
+ "DefinedTermBase", 99);
+ stepList.add(step);
+
+ // Rename tables
+ stepName = "Rename DefinedTermBase_WaterbodyOrCountry";
+ String oldName = "DefinedTermBase_WaterbodyOrCountry";
+ String newName = "DefinedTermBase_Country";
+ step = TableNameChanger.NewInstance(stepName, oldName, newName,
+ INCLUDE_AUDIT);
+ stepList.add(step);
+
+ // rename column
+ stepName = "Rename DefinedTermBase_Country.waterbodiesorcountries_id";
+ tableName = "DefinedTermBase_Country";
+ String oldColumnName = "waterbodiesorcountries_id";
+ String newColumnName = "countries_id";
+ step = ColumnNameChanger.NewIntegerInstance(stepName, tableName,
+ oldColumnName, newColumnName, INCLUDE_AUDIT);
+ stepList.add(step);
+
+ // NULL for empty strings
+ stepName = "Update idInVocabulary, replace empty strings by null";
+ query = "Update @@DefinedTermBase@@ dtb SET idInVocabulary = NULL WHERE idInVocabulary = ''";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // MarkerType, AnnotationType, NamedAreaType, NamedAreaLevel, Feature,
+ // Continent, DerivationEventType, StatisticalMeasure,
+ // RightsType,SynonymRelationshipType & HybridRelationshipType &
+ // NameRelationshipType
+ // => none
+
+ // DnaMarker => yes but no entries
+
+ // Clean up empty abbreviated labels in representations
+ stepName = "Update abbreviated label, replace empty strings by null";
+ query = "UPDATE @@Representation@@ SET abbreviatedLabel = NULL WHERE abbreviatedLabel = ''";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing("Representation"); // AUD not needed
+ stepList.add(step);
+
+ }
+
+ private void updateTermTypesForVocabularies(
+ List<ISchemaUpdaterStep> stepList) {
+ // vocabularies with terms
+ for (TermType termType : TermType.values()) {
+ updateTermTypeForVocabularies(stepList, termType);
+ }
+
+ String tableName = "TermVocabulary";
+ // Natural Language Terms
+ String stepName = "Updater termType for NaturalLanguageTerms";
+ String query = "UPDATE @@TermVocabulary@@ " + " SET termType = '"
+ + TermType.NaturalLanguageTerm.getKey() + "' "
+ + " WHERE uuid = 'fdaba4b0-5c14-11df-a08a-0800200c9a66'";
+ ISchemaUpdaterStep step = SimpleSchemaUpdaterStep
+ .NewNonAuditedInstance(stepName, query, 99).setDefaultAuditing(
+ tableName);
+ stepList.add(step);
+
+ // remaining vocabularies
+ stepName = "Updater termType for remaining vocabularies";
+ query = "UPDATE @@TermVocabulary@@ " + " SET termType = '"
+ + TermType.Unknown.getKey() + "' "
+ + " WHERE termType IS NULL";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ }
+
+ private void updateTermTypeForVocabularies(
+ List<ISchemaUpdaterStep> stepList, TermType termType) {
+ String stepName = "Updater vocabulary termType for "
+ + termType.toString();
+ String query = "UPDATE @@TermVocabulary@@ "
+ + " SET termType = '"
+ + termType.getKey()
+ + "' "
+ + " WHERE Exists (SELECT * FROM @@DefinedTermBase@@ dtb WHERE dtb.termType = '"
+ + termType.getKey() + "' AND dtb.vocabulary_id = @@TermVocabulary@@.id)";
+ ISchemaUpdaterStep step = SimpleSchemaUpdaterStep
+ .NewNonAuditedInstance(stepName, query, 99).setDefaultAuditing(
+ "TermVocabulary"); // AUD not fully correct as subselect
+ // should also work on AUD, good enough for our purposes
+ stepList.add(step);
+ }
+
+ /**
+ * @param stepList
+ * @param stepName
+ */
+ private void updateTermTypesForTerms(List<ISchemaUpdaterStep> stepList) {
+ String stepName = "Update termType for NamedAreas";
+ String tableName = "DefinedTermBase";
+
+ //NamedArea
+ String query = " UPDATE @@DefinedTermBase@@ " +
+ " SET termType = '" + TermType.NamedArea.getKey() + "' " +
+ " WHERE DTYPE = '" + NamedArea.class.getSimpleName() + "' OR DTYPE = 'TdwgArea' " +
+ "OR DTYPE = 'WaterbodyOrCountry' OR DTYPE = '"+ Country.class.getSimpleName() + "' OR DTYPE = 'Continent' ";
+ ISchemaUpdaterStep step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99).setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // Lanugage
+ stepName = "Update termType for Language";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.Language.getKey() + "' " + " WHERE DTYPE = '"
+ + Language.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // RANK
+ stepName = "Update termType for Rank";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.Rank.getKey() + "' " + " WHERE DTYPE = '"
+ + Rank.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // Feature
+ stepName = "Update termType for Feature";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.Feature.getKey() + "' " + " WHERE DTYPE = '"
+ + Feature.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // AnnotationType
+ stepName = "Update termType for Annotation Type";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.AnnotationType.getKey() + "' " + " WHERE DTYPE = '"
+ + AnnotationType.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // MarkerType
+ stepName = "Update termType for Marker Type";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.MarkerType.getKey() + "' " + " WHERE DTYPE = '"
+ + MarkerType.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // ExtensionType
+ stepName = "Update termType for Extension Type";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.ExtensionType.getKey() + "' " + " WHERE DTYPE = '"
+ + ExtensionType.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // DerivationEventType
+ stepName = "Update termType for DerivationEvent Type";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.DerivationEventType.getKey() + "' "
+ + " WHERE DTYPE = '"
+ + DerivationEventType.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // PresenceAbsenceTerm
+ stepName = "Update termType for PresenceAbsence Term";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.PresenceAbsenceTerm.getKey() + "' "
+ + " WHERE DTYPE = 'PresenceTerm' OR DTYPE = 'AbsenceTerm'";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // NomenclaturalStatusType
+ stepName = "Update termType for NomenclaturalStatusType";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.NomenclaturalStatusType.getKey() + "' "
+ + " WHERE DTYPE = '"
+ + NomenclaturalStatusType.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // NameRelationshipType
+ stepName = "Update termType for NameRelationship Type";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.NameRelationshipType.getKey() + "' "
+ + " WHERE DTYPE = '"
+ + NameRelationshipType.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // HybridRelationshipType
+ stepName = "Update termType for HybridRelationship Type";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.HybridRelationshipType.getKey() + "' "
+ + " WHERE DTYPE = '"
+ + HybridRelationshipType.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // SynonymRelationshipType
+ stepName = "Update termType for SynonymRelationship Type";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.SynonymRelationshipType.getKey() + "' "
+ + " WHERE DTYPE = '"
+ + SynonymRelationshipType.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // TaxonRelationshipType
+ stepName = "Update termType for TaxonRelationship Type";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.TaxonRelationshipType.getKey() + "' "
+ + " WHERE DTYPE = '"
+ + TaxonRelationshipType.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // NameTypeDesignationStatus
+ stepName = "Update termType for NameTypeDesignationStatus";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.NameTypeDesignationStatus.getKey() + "' "
+ + " WHERE DTYPE = '"
+ + NameTypeDesignationStatus.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // SpecimenTypeDesignationStatus
+ stepName = "Update termType for SpecimenTypeDesignationStatus";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.SpecimenTypeDesignationStatus.getKey() + "' "
+ + " WHERE DTYPE = '"
+ + SpecimenTypeDesignationStatus.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // InstitutionType
+ stepName = "Update termType for Institution Type";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.InstitutionType.getKey() + "' "
+ + " WHERE DTYPE = 'InstitutionType' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // NamedAreaType
+ stepName = "Update termType for NamedArea Type";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.NamedAreaType.getKey() + "' " + " WHERE DTYPE = '"
+ + NamedAreaType.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // NamedAreaLevel
+ stepName = "Update termType for NamedArea Level";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.NamedAreaLevel.getKey() + "' " + " WHERE DTYPE = '"
+ + NamedAreaLevel.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // RightsType
+ stepName = "Update termType for Rights Type";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.RightsType.getKey() + "' "
+ + " WHERE DTYPE = 'RightsType' OR DTYPE = 'RightsTerm' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // MeasurementUnit
+ stepName = "Update termType for MeasurementUnit";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.MeasurementUnit.getKey() + "' " + " WHERE DTYPE = '"
+ + MeasurementUnit.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // StatisticalMeasure
+ stepName = "Update termType for Statistical Measure";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.StatisticalMeasure.getKey() + "' "
+ + " WHERE DTYPE = '" + StatisticalMeasure.class.getSimpleName()
+ + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // PreservationMethod
+ stepName = "Update termType for Preservation Method";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.Method.getKey() + "' " + " WHERE DTYPE = '"
+ + PreservationMethod.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // Modifier
+ stepName = "Update termType for Modifier";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.Modifier.getKey() + "' "
+ + " WHERE DTYPE = 'Modifier' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // Scope
+ stepName = "Update termType for Scope";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.Scope.getKey() + "' " + " WHERE DTYPE = 'Scope' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // Stage
+ stepName = "Update termType for Stage";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.Stage.getKey() + "' " + " WHERE DTYPE = 'Stage' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // Sex
+ stepName = "Update termType for Sex";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.Sex.getKey() + "' " + " WHERE DTYPE = 'Sex' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // ReferenceSystem
+ stepName = "Update termType for ReferenceSystem";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.ReferenceSystem.getKey() + "' " + " WHERE DTYPE = '"
+ + ReferenceSystem.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // State
+ stepName = "Update termType for State";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.State.getKey() + "' " + " WHERE DTYPE = '"
+ + State.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // NaturalLanguageTerm
+ stepName = "Update termType for NaturalLanguageTerm";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.NaturalLanguageTerm.getKey() + "' "
+ + " WHERE DTYPE = '"
+ + NaturalLanguageTerm.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // TextFormat
+ stepName = "Update termType for TextFormat";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.TextFormat.getKey() + "' " + " WHERE DTYPE = '"
+ + TextFormat.class.getSimpleName() + "' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);
+ stepList.add(step);
+
+ // DeterminationModifier
+ stepName = "Update termType for DeterminationModifier";
+ query = " UPDATE @@DefinedTermBase@@ " + " SET termType = '"
+ + TermType.DeterminationModifier.getKey() + "' "
+ + " WHERE DTYPE = 'DeterminationModifier' ";
+ step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, 99)
+ .setDefaultAuditing(tableName);