package eu.etaxonomy.cdm.model.location;
+import eu.etaxonomy.cdm.model.common.ILoadableTerm;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
import eu.etaxonomy.cdm.model.common.TimePeriod;
import eu.etaxonomy.cdm.model.common.OrderedTermBase;
import eu.etaxonomy.cdm.model.media.Media;
@ManyToOne
- @Cascade({CascadeType.SAVE_UPDATE})
+ //@Cascade({CascadeType.SAVE_UPDATE}) //NamedAreaType is DefinedTerm -> no Cascade
public NamedAreaType getType(){
return this.type;
}
}
@ManyToOne
- @Cascade({CascadeType.SAVE_UPDATE})
+ //@Cascade({CascadeType.SAVE_UPDATE}) //NamedAreaLevel is DefinedTerm -> no Cascade
public NamedAreaLevel getLevel(){
return this.level;
}
this.shape = shape;
}
-
- @ManyToMany
+ @ManyToMany
+ @JoinTable(
+ name="DefinedTermBase_WaterbodyOrCountry"
+ )
@Cascade({CascadeType.SAVE_UPDATE})
public Set<WaterbodyOrCountry> getWaterbodiesOrCountries() {
return waterbodiesOrCountries;
public void setPointApproximation(Point pointApproximation) {
this.pointApproximation = pointApproximation;
}
+
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.model.common.DefinedTermBase#readCsvLine(java.util.List)
+ */
+ @Override
+ public ILoadableTerm readCsvLine(List csvLine) {
+ Language lang = Language.DEFAULT();
+ super.readCsvLine(csvLine, lang);
+ String abbreviatedLabel = (String)csvLine.get(4);
+ this.getRepresentation(lang).setAbbreviatedLabel(abbreviatedLabel);
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.model.common.OrderedTermBase#setVocabulary(eu.etaxonomy.cdm.model.common.TermVocabulary)
+ */
+ @Override
+ public void setVocabulary(TermVocabulary newVocabulary) {
+ super.setVocabulary(newVocabulary);
+ if (newVocabulary.equals(TermVocabulary.TDWG())){
+ TdwgArea.addTdwgArea(this);
+ }
+ }
+
+
}
\ No newline at end of file