Project

General

Profile

Revision f800c017

IDf800c017c3a6835d5a6240f12df7e64955ded3aa
Parent 5b113fbe
Child 3bcb7fc8

Added by Andreas Müller about 2 months ago

ref #6581 move references to sources for NomenclaturalStatus, NameRelationship, TaxonRelationship, HybridRelationship, TypeDesignation and TaxonName.nomenclaturalReference

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/SchemaUpdaterStepBase.java
156 156
        return param == null ? "NULL" : "'" + param + "'";
157 157
    }
158 158

  
159
    protected Integer nullSafeInt(ResultSet rs, String columnName) throws SQLException {
160
        Object intObject = rs.getObject(columnName);
161
        if (intObject == null){
162
            return null;
163
        }else{
164
            return Integer.valueOf(intObject.toString());
165
        }
166
    }
167

  
168
    protected boolean isNotBlank(String str) {
169
        return StringUtils.isNotBlank(str);
170
    }
171

  
172
    protected boolean isBlank(String str) {
173
        return StringUtils.isBlank(str);
174
    }
175

  
159 176
	@Override
160 177
	public String toString(){
161 178
		if (StringUtils.isNotBlank(stepName)){
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v512_515/Reference2SourceMover.java
94 94

  
95 95
        }
96 96
    }
97

  
98
    protected Integer nullSafeInt(ResultSet rs, String columnName) throws SQLException {
99
        Object intObject = rs.getObject(columnName);
100
        if (intObject == null){
101
            return null;
102
        }else{
103
            return Integer.valueOf(intObject.toString());
104
        }
105
    }
106

  
107

  
108 97
}
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v515_518/SchemaUpdater_5152_5180.java
16 16
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
17 17
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
18 18
import eu.etaxonomy.cdm.database.update.SchemaUpdaterBase;
19
import eu.etaxonomy.cdm.database.update.v512_515.Reference2SourceMover;
19 20
import eu.etaxonomy.cdm.database.update.v512_515.SchemaUpdater_5151_5152;
20 21
import eu.etaxonomy.cdm.model.metadata.CdmMetaData.CdmVersion;
21 22

  
......
49 50

  
50 51
		List<ISchemaUpdaterStep> stepList = new ArrayList<>();
51 52

  
52
		return stepList;
53
        //6581
54
        //move nomenclatural status reference to source
55
        stepName = "move nomenclatural status reference to source";
56
        tableName = "NomenclaturalStatus";
57
        String referenceColumnName = "citation_id";
58
        String microReferenceColumnName = "citationMicroReference";
59
        String sourceColumnName = "source_id";
60
        Reference2SourceMover.NewInstance(stepList, tableName, referenceColumnName, microReferenceColumnName, sourceColumnName);
61

  
62
        //6581
63
        //move name relationship reference to source
64
        stepName = "move name relationship reference to source";
65
        tableName = "NameRelationship";
66
        referenceColumnName = "citation_id";
67
        microReferenceColumnName = "citationMicroReference";
68
        sourceColumnName = "source_id";
69
        Reference2SourceMover.NewInstance(stepList, tableName, referenceColumnName, microReferenceColumnName, sourceColumnName);
70

  
71
        //6581
72
        //move taxon relationship reference to source
73
        stepName = "move taxon relationship reference to source";
74
        tableName = "TaxonRelationship";
75
        referenceColumnName = "citation_id";
76
        microReferenceColumnName = "citationMicroReference";
77
        sourceColumnName = "source_id";
78
        Reference2SourceMover.NewInstance(stepList, tableName, referenceColumnName, microReferenceColumnName, sourceColumnName);
79

  
80
        //6581
81
        //move hybrid relationship reference to source
82
        stepName = "move hybrid relationship reference to source";
83
        tableName = "HybridRelationship";
84
        referenceColumnName = "citation_id";
85
        microReferenceColumnName = "citationMicroReference";
86
        sourceColumnName = "source_id";
87
        Reference2SourceMover.NewInstance(stepList, tableName, referenceColumnName, microReferenceColumnName, sourceColumnName);
88

  
89
        //6581
90
        //move type designation reference to source
91
        stepName = "move type designation reference to source";
92
        tableName = "TypeDesignationBase";
93
        referenceColumnName = "citation_id";
94
        microReferenceColumnName = "citationMicroReference";
95
        sourceColumnName = "source_id";
96
        Reference2SourceMover.NewInstance(stepList, tableName, referenceColumnName, microReferenceColumnName, sourceColumnName);
97

  
98
        //6581
99
        //move nomenclatural reference to nomenclatural source
100
        stepName = "move nomenclatural reference to nomenclatural source";
101
        tableName = "TaxonName";
102
        referenceColumnName = "nomenclaturalReference_id";
103
        microReferenceColumnName = "nomenclaturalMicroReference";
104
        sourceColumnName = "nomenclaturalSource_id";
105
        Reference2SourceMover.NewInstance(stepList, tableName, referenceColumnName, microReferenceColumnName, sourceColumnName);
106

  
107
        return stepList;
53 108
    }
54 109

  
110

  
55 111
    @Override
56 112
    public ISchemaUpdater getPreviousUpdater() {
57 113
        return SchemaUpdater_5151_5152.NewInstance();

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)