Project

General

Profile

Revision 73b20217

ID73b202173e57e68f69361785178706f08648facb
Parent ef1b5da2
Child 8a52bc4f

Added by Andreas Müller over 4 years ago

Add symbol and reverseSymbol do DefinedTermBase #5734

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/DefinedTermBase.java
73 73
@XmlType(name = "DefinedTermBase", propOrder = {
74 74
    "media",
75 75
    "vocabulary",
76
    "idInVocabulary"
76
    "idInVocabulary",
77
    "symbol"
77 78
})
78 79
@XmlRootElement(name = "DefinedTermBase")
79 80
@XmlSeeAlso({
......
169 170
//  @NullOrNotEmpty
170 171
    private String idInVocabulary;  //the unique identifier/name this term uses in its given vocabulary #3479
171 172

  
172

  
173
    @XmlElement(name = "symbol")
174
    @Column(length=10)
175
    //the symbol to be used in String representations for this term  #5734
176
    //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
177
    //empty string is explicitly allowed and should be distinguished from NULL!
178
    private String symbol;
173 179

  
174 180
//***************************** CONSTRUCTOR *******************************************/
175 181

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

  
84
    @XmlElement(name = "reverseSymbol")
85
    @Column(length=10)
86
    //the symbol to be used in String representations for the reverse representation of this term #5734
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
    //empty string is explicitly allowed and should be distinguished from NULL!
89
    private String reverseSymbol;
90

  
83 91
//******************** CONSTRUCTOR ************************/
84 92

  
85 93
    //for JAXB only, TODO needed?
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v36_40/SchemaUpdater_36_40.java
108 108
        step = ColumnRemover.NewInstance(stepName, tableName, newColumnName, ! INCLUDE_AUDIT);
109 109
        stepList.add(step);
110 110

  
111
        ///#5369
111
        //#5734
112
        //Add symbol to terms
113
        stepName = "Add symbols to terms";
114
        tableName = "DefinedTermBase";
115
        newColumnName = "symbol";
116
        step = ColumnAdder.NewStringInstance(stepName, tableName, newColumnName, 10, INCLUDE_AUDIT);
117
        stepList.add(step);
118

  
119
        //Add reverse symbol to terms
120
        stepName = "Add reverse symbol to terms";
121
        tableName = "DefinedTermBase";
122
        newColumnName = "reverseSymbol";
123
        step = ColumnAdder.NewStringInstance(stepName, tableName, newColumnName, 10, INCLUDE_AUDIT);
124
        stepList.add(step);
125

  
126
        //TODO update existing terms like concept relationship types or presenceAbsenceTerms
127

  
128
        //#5369
112 129
        renameColumnsAccordingToHibernate5(stepList);
113 130

  
114 131

  
cdmlib-test/src/main/resources/dbscripts/001-cdm.h2.sql
907 907
    UPDATED TIMESTAMP,
908 908
    TERMTYPE VARCHAR(4),
909 909
    IDINVOCABULARY VARCHAR(255),
910
	SYMBOL VARCHAR(10),
911
	REVERSESYMBOL VARCHAR(10),
910 912
    LSID_AUTHORITY VARCHAR(255),
911 913
    LSID_LSID VARCHAR(255),
912 914
    LSID_NAMESPACE VARCHAR(255),
......
958 960
    UPDATED TIMESTAMP,
959 961
    TERMTYPE VARCHAR(4),
960 962
    IDINVOCABULARY VARCHAR(255),
963
	SYMBOL VARCHAR(10),
964
	REVERSESYMBOL VARCHAR(10),
961 965
    LSID_AUTHORITY VARCHAR(255),
962 966
    LSID_LSID VARCHAR(255),
963 967
    LSID_NAMESPACE VARCHAR(255),

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)