Project

General

Profile

« Previous | Next » 

Revision 65df4525

Added by Andreas Müller about 5 years ago

fix #7857 update name relationship type respresentations and symmetrie

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v50_51/SchemaUpdater_50_55.java
11 11

  
12 12
import java.util.ArrayList;
13 13
import java.util.List;
14
import java.util.UUID;
14 15

  
15 16
import org.apache.log4j.Logger;
16 17

  
......
21 22
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
22 23
import eu.etaxonomy.cdm.database.update.SchemaUpdaterBase;
23 24
import eu.etaxonomy.cdm.database.update.SimpleSchemaUpdaterStep;
25
import eu.etaxonomy.cdm.database.update.TermRepresentationUpdater;
24 26
import eu.etaxonomy.cdm.database.update.v47_50.SchemaUpdater_47_50;
25 27

  
26 28
/**
......
101 103
                columnName, columnName, INCLUDE_AUDIT);
102 104
        stepList.add(step);
103 105

  
106
        //7857 update name realtionships
107
        updateNameRelationships(stepList);
108

  
104 109
        return stepList;
105 110

  
106 111
	}
107 112

  
108 113

  
114
	//7857 update name realtionships
115
    private void updateNameRelationships(List<ISchemaUpdaterStep> stepList) {
116

  
117
        //7857 Update symmetrical for name relationships
118
        String stepName = "Update symmetrical for name relationships";
119
        String query = "UPDATE @@DefinedTermBase@@ "
120
                + " SET symmetrical=0 "
121
                + " WHERE uuid IN ('049c6358-1094-4765-9fae-c9972a0e7780', '6e23ad45-3f2a-462b-ad87-d2389cd6e26c', "
122
                + " 'c6f9afcb-8287-4a2b-a6f6-4da3a073d5de', 'eeaea868-c4c1-497f-b9fe-52c9fc4aca53') ";
123
        String tableName = "DefinedTermBase";
124
        ISchemaUpdaterStep step = SimpleSchemaUpdaterStep.NewAuditedInstance(stepName, query, tableName, -99);
125
        stepList.add(step);
126

  
127
        //orthographic variant for
128
        stepName = "orthographic variant for => is orthographic variant for";
129
        UUID uuidTerm = UUID.fromString("eeaea868-c4c1-497f-b9fe-52c9fc4aca53");
130
        UUID uuidLanguage = UUID.fromString("e9f8cdb7-6819-44e8-95d3-e2d0690c3523");
131
        String label = "is orthographic variant for";
132
        step = TermRepresentationUpdater.NewInstanceWithTitleCache(stepName, uuidTerm,
133
                label, label, null, uuidLanguage);
134
        stepList.add(step);
135

  
136
        //original spelling for
137
        stepName = "original spelling for => is original spelling for";
138
        uuidTerm = UUID.fromString("264d2be4-e378-4168-9760-a9512ffbddc4");
139
        label = "is original spelling for";
140
        step = TermRepresentationUpdater.NewInstanceWithTitleCache(stepName, uuidTerm,
141
                label, label, null, uuidLanguage);
142
        stepList.add(step);
143

  
144
        //misspelling for
145
        stepName = "misspelling for => is misspelling for";
146
        uuidTerm = UUID.fromString("c6f9afcb-8287-4a2b-a6f6-4da3a073d5de");
147
        label = "is misspelling for";
148
        step = TermRepresentationUpdater.NewInstanceWithTitleCache(stepName, uuidTerm,
149
                label, label, null, uuidLanguage);
150
        stepList.add(step);
151

  
152
        //later homonym for
153
        stepName = "later homonym for => is later homonym for";
154
        uuidTerm = UUID.fromString("80f06f65-58e0-4209-b811-cb40ad7220a6");
155
        label = "is later homonym for";
156
        step = TermRepresentationUpdater.NewInstanceWithTitleCache(stepName, uuidTerm,
157
                label, label, null, uuidLanguage);
158
        stepList.add(step);
159

  
160
        //treated as later homonym for
161
        stepName = " => is treated as later homonym for";
162
        uuidTerm = UUID.fromString("2990a884-3302-4c8b-90b2-dfd31aaa2778");
163
        label = "is treated as later homonym for";
164
        step = TermRepresentationUpdater.NewInstanceWithTitleCache(stepName, uuidTerm,
165
                label, label, null, uuidLanguage);
166
        stepList.add(step);
167

  
168
        //alternative name for
169
        stepName = "alternative name for => is alternative name for";
170
        uuidTerm = UUID.fromString("049c6358-1094-4765-9fae-c9972a0e7780");
171
        label = "is alternative name for";
172
        step = TermRepresentationUpdater.NewInstanceWithTitleCache(stepName, uuidTerm,
173
                label, label, null, uuidLanguage);
174
        stepList.add(step);
175

  
176
        //basionym for
177
        stepName = "basionym for => is basionym for";
178
        uuidTerm = UUID.fromString("25792738-98de-4762-bac1-8c156faded4a");
179
        label = "is basionym for";
180
        step = TermRepresentationUpdater.NewInstanceWithTitleCache(stepName, uuidTerm,
181
                label, label, null, uuidLanguage);
182
        stepList.add(step);
183

  
184
        //replaced synonym for
185
        stepName = "replaced synonym for => is replaced synonym for";
186
        uuidTerm = UUID.fromString("71c67c38-d162-445b-b0c2-7aba56106696");
187
        label = "is replaced synonym for";
188
        step = TermRepresentationUpdater.NewInstanceWithTitleCache(stepName, uuidTerm,
189
                label, label, null, uuidLanguage);
190
        stepList.add(step);
191

  
192
        //conserved against
193
        stepName = "conserved against => is conserved against";
194
        uuidTerm = UUID.fromString("e6439f95-bcac-4ebb-a8b5-69fa5ce79e6a");
195
        label = "is conserved against";
196
        step = TermRepresentationUpdater.NewInstanceWithTitleCache(stepName, uuidTerm,
197
                label, label, null, uuidLanguage);
198
        stepList.add(step);
199

  
200
        //validated by
201
        stepName = "validated by => is validated by";
202
        uuidTerm = UUID.fromString("a176c9ad-b4c2-4c57-addd-90373f8270eb");
203
        label = "is validated by";
204
        step = TermRepresentationUpdater.NewInstanceWithTitleCache(stepName, uuidTerm,
205
                label, label, null, uuidLanguage);
206
        stepList.add(step);
207

  
208
        //later validated by
209
        stepName = "later validated by => is later validated by";
210
        uuidTerm = UUID.fromString("a25ee4c1-863a-4dab-9499-290bf9b89639");
211
        label = "is later validated by";
212
        step = TermRepresentationUpdater.NewInstanceWithTitleCache(stepName, uuidTerm,
213
                label, label, null, uuidLanguage);
214
        stepList.add(step);
215

  
216
        //blocking name for
217
        stepName = "blocking name for => is blocking name for";
218
        uuidTerm = UUID.fromString("1dab357f-2e12-4511-97a4-e5153589e6a6");
219
        label = "blocking name for";
220
        step = TermRepresentationUpdater.NewInstanceWithTitleCache(stepName, uuidTerm,
221
                label, label, null, uuidLanguage);
222
        stepList.add(step);
223

  
224
        //emendation for
225
        stepName = "emendation for => is emendation for";
226
        uuidTerm = UUID.fromString("6e23ad45-3f2a-462b-ad87-d2389cd6e26c");
227
        label = "is emendation for";
228
        step = TermRepresentationUpdater.NewReverseInstance(stepName, uuidTerm,
229
                label, label, null, uuidLanguage);
230
        stepList.add(step);
231
    }
232

  
109 233
    @Override
110 234
	public ISchemaUpdater getNextUpdater() {
111 235
		return null;

Also available in: Unified diff