import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
+import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Transient;
+import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
@XmlElement(name = "Medium")
@XmlIDREF
@XmlSchemaType(name = "IDREF")
- @OneToMany(fetch = FetchType.LAZY)
+ @ManyToMany(fetch = FetchType.LAZY)
+ @OneToMany(fetch = FetchType.LAZY)
@Cascade({CascadeType.SAVE_UPDATE})
private Set<Media> media = new HashSet<Media>();
@Cascade(CascadeType.SAVE_UPDATE)
protected TermVocabulary<T> vocabulary;
+//***************************** CONSTRUCTOR *******************************************/
+
public DefinedTermBase() {
super();
}
super(term, label, labelAbbrev);
}
- protected abstract void setDefaultTerms(TermVocabulary<T> termVocabulary);
+//******************************* METHODS ******************************************************/
+
+ public abstract void resetTerms();
+ protected abstract void setDefaultTerms(TermVocabulary<T> termVocabulary);
+
+
/* (non-Javadoc)
* @see eu.etaxonomy.cdm.model.common.ILoadableTerm#readCsvLine(java.util.List)
*/
public T readCsvLine(Class<T> termClass, List<String> csvLine, Map<UUID,DefinedTermBase> terms) {
try {
T newInstance = termClass.newInstance();
- return readCsvLine(newInstance, csvLine, Language.ENGLISH());
+ return readCsvLine(newInstance, csvLine, Language.CSV_LANGUAGE());
} catch (Exception e) {
logger.error(e);
for(StackTraceElement ste : e.getStackTrace()) {
this.media.remove(media);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.model.common.IDefinedTerm#getVocabulary()
+ /**
+ * @return
*/
public TermVocabulary<T> getVocabulary() {
return this.vocabulary;
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.model.common.IDefinedTerm#setVocabulary(eu.etaxonomy.cdm.model.common.TermVocabulary)
+
+ //for bedirectional use only, use vocabulary.addTerm instead
+ /**
+ * @param newVocabulary
*/
- public void setVocabulary(TermVocabulary<T> newVocabulary) {
+ protected void setVocabulary(TermVocabulary<T> newVocabulary) {
this.vocabulary = newVocabulary;
}
}
\ No newline at end of file