Project

General

Profile

Revision dc5c692a

IDdc5c692a04a8b78e7f10590cc67f9999ca4c854e
Parent 32acf672
Child 1089f0e4

Added by Andreas Müller over 4 years ago

Change reverseSymbol to inverseSymbol #5734

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/RelationshipTermBase.java
49 49
    "symmetric",
50 50
    "transitive",
51 51
    "inverseRepresentations",
52
    "reverseSymbol"
52
    "inverseSymbol"
53 53
})
54 54
@XmlSeeAlso({
55 55
	HybridRelationshipType.class,
......
81 81
	@IndexedEmbedded(depth = 2)
82 82
	private Set<Representation> inverseRepresentations = new HashSet<Representation>();
83 83

  
84
    @XmlElement(name = "reverseSymbol")
84
    @XmlElement(name = "inverseSymbol")
85 85
    @Column(length=10)
86 86
    //the symbol to be used in String representations for the reverse representation of this term #5734
87 87
    //this term can be changed by the database instance even if the term is not managed by this instance as it is only for representation and has no semantic or identifying character
88 88
    //empty string is explicitly allowed and should be distinguished from NULL!
89
    private String reverseSymbol;
89
    private String inverseSymbol;
90 90

  
91 91
//******************** CONSTRUCTOR ************************/
92 92

  
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v36_40/SchemaUpdater_36_40.java
116 116
        step = ColumnAdder.NewStringInstance(stepName, tableName, newColumnName, 10, INCLUDE_AUDIT);
117 117
        stepList.add(step);
118 118

  
119
        //Add reverse symbol to terms
120
        stepName = "Add reverse symbol to terms";
119
        stepName = "Update symbols for terms";
120
        query = "UPDATE @@DefinedTermBase@@ SET symbol = idInVocabulary WHERE idInVocabulary <> ''";
121
        step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, -99);
122
        stepList.add(step);
123

  
124

  
125
        //Add inverse symbol to terms
126
        stepName = "Add inverse symbol to terms";
121 127
        tableName = "DefinedTermBase";
122
        newColumnName = "reverseSymbol";
128
        newColumnName = "inverseSymbol";
123 129
        step = ColumnAdder.NewStringInstance(stepName, tableName, newColumnName, 10, INCLUDE_AUDIT);
124 130
        stepList.add(step);
125 131

  
126
        //TODO update existing terms like concept relationship types or presenceAbsenceTerms
132
        stepName = "Update symbols for terms";
133
        query = "UPDATE DefinedTermBase dtb SET dtb.verseSymbol = ( " +
134
            " SELECT  r.abbreviatedlabel " +
135
            " FROM RelationshipTermBase_inverseRepresentation MN " +
136
                " INNER JOIN Representation r ON r.id = MN.inverserepresentations_id " +
137
            " WHERE dtb.id = MN.relationshiptermbase_id AND r.abbreviatedlabel <> '' ) ";
138
        step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query, -99);
139
        stepList.add(step);
127 140

  
128 141
        //#5369
129 142
        renameColumnsAccordingToHibernate5(stepList);
cdmlib-test/src/main/resources/dbscripts/001-cdm.h2.sql
908 908
    TERMTYPE VARCHAR(4),
909 909
    IDINVOCABULARY VARCHAR(255),
910 910
	SYMBOL VARCHAR(10),
911
	REVERSESYMBOL VARCHAR(10),
911
	INVERSESYMBOL VARCHAR(10),
912 912
    LSID_AUTHORITY VARCHAR(255),
913 913
    LSID_LSID VARCHAR(255),
914 914
    LSID_NAMESPACE VARCHAR(255),
......
961 961
    TERMTYPE VARCHAR(4),
962 962
    IDINVOCABULARY VARCHAR(255),
963 963
	SYMBOL VARCHAR(10),
964
	REVERSESYMBOL VARCHAR(10),
964
	INVERSESYMBOL VARCHAR(10),
965 965
    LSID_AUTHORITY VARCHAR(255),
966 966
    LSID_LSID VARCHAR(255),
967 967
    LSID_NAMESPACE VARCHAR(255),

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)