Project

General

Profile

Revision 696ecfe8

ID696ecfe85f0a850183b534601f631c9c988d81e0
Parent 8947f698
Child 38dc3727

Added by Andreas Müller over 3 years ago

fix #5817 rename RelationshipTermBase_inverseRepresentation

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/RelationshipTermBase.java
19 19
import javax.persistence.Column;
20 20
import javax.persistence.Entity;
21 21
import javax.persistence.FetchType;
22
import javax.persistence.JoinColumn;
22 23
import javax.persistence.JoinTable;
23 24
import javax.persistence.OneToMany;
24 25
import javax.persistence.Transient;
......
76 77
	@XmlElementWrapper(name = "InverseRepresentations")
77 78
	@XmlElement(name = "Representation")
78 79
	@OneToMany(fetch = FetchType.LAZY, orphanRemoval=true)
79
	@JoinTable(name="RelationshipTermBase_inverseRepresentation")
80
	@JoinTable(name="TermBase_inverseRepresentation",
81
        joinColumns=@JoinColumn(name="term_id")
82
    )
80 83
	@Cascade({CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE})
81 84
	@IndexedEmbedded(depth = 2)
82
	private Set<Representation> inverseRepresentations = new HashSet<Representation>();
85
	private Set<Representation> inverseRepresentations = new HashSet<>();
83 86

  
84 87
    @XmlElement(name = "inverseSymbol")
85 88
    @Column(length=30)
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/Feature.java
146 146
	@XmlElementWrapper(name = "InverseRepresentations")
147 147
    @XmlElement(name = "Representation")
148 148
    @OneToMany(fetch = FetchType.LAZY, orphanRemoval=true)
149
    @JoinTable(name="RelationshipTermBase_inverseRepresentation",
150
            joinColumns=@JoinColumn(name="relationshiptermbase_id")
149
    @JoinTable(name="TermBase_inverseRepresentation",
150
        joinColumns=@JoinColumn(name="term_id")
151 151
    )
152 152
    @Cascade({CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE})
153 153
//    @IndexedEmbedded(depth = 2)
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v41_47/SchemaUpdater_41_47.java
222 222
        step = ColumnAdder.NewIntegerInstance(stepName, tableName, newColumnName, INCLUDE_AUDIT, !NOT_NULL, referencedTable);
223 223
        stepList.add(step);
224 224

  
225
        //#5817 rename relationshipTermBase_inverseRepresentation
226
        stepName = "Rename relationshipTermBase_inverseRepresentation";
227
        String oldName = "RelationshipTermBase_inverseRepresentation";
228
        String newName = "TermBase_inverseRepresentation";
229
        step = TableNameChanger.NewInstance(stepName, oldName, newName, INCLUDE_AUDIT);
230
        stepList.add(step);
231

  
232
        //#5817 rename TermBase_inverseRepresentation.relationshipTermBase_id
233
        stepName = "Rename relationshipTermBase_inverseRepresentation.relationshipTermBase_id";
234
        tableName = newName;
235
        String oldColumnName = "relationshipTermBase_id";
236
        newColumnName = "term_id";
237
        step = ColumnNameChanger.NewIntegerInstance(stepName, tableName, oldColumnName, newColumnName, INCLUDE_AUDIT);
238
        stepList.add(step);
225 239

  
226 240
        return stepList;
227 241
    }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)