import java.util.*;
import javax.persistence.*;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
/**
* @author m.doering
* @version 1.0
* @created 08-Nov-2007 13:06:55
*/
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Synonym", propOrder = {
+ "synonymRelations"
+})
@XmlRootElement(name = "Synonym")
@Entity
public class Synonym extends TaxonBase implements IRelated<SynonymRelationship>{
+
static Logger logger = Logger.getLogger(Synonym.class);
+ @XmlElementWrapper(name = "SynonymRelations")
+ @XmlElement(name = "SynonymRelationship")
private Set<SynonymRelationship> synonymRelations = new HashSet<SynonymRelationship>();
public static Synonym NewInstance(TaxonNameBase taxonName, ReferenceBase sec){
import org.apache.log4j.Logger;
import javax.persistence.*;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
/**
* @author m.doering
* @version 1.0
* @created 08-Nov-2007 13:06:55
*/
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "")
+@XmlRootElement(name = "SynonymRelationship")
@Entity
public class SynonymRelationship extends RelationshipBase<Synonym, Taxon, SynonymRelationshipType> {
private static final Logger logger = Logger.getLogger(SynonymRelationship.class);
import java.util.UUID;
import javax.persistence.Entity;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
import org.apache.log4j.Logger;
import eu.etaxonomy.cdm.model.common.RelationshipTermBase;
* @created 08-Nov-2007 13:06:55
* http://rs.tdwg.org/ontology/voc/TaxonConcept#TaxonRelationshipTerm
*/
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "SynonymRelationshipType")
@Entity
public class SynonymRelationshipType extends RelationshipTermBase<SynonymRelationshipType> {
+
static Logger logger = Logger.getLogger(SynonymRelationshipType.class);
private static final UUID uuidSynonymOf = UUID.fromString("1afa5429-095a-48da-8877-836fa4fe709e");
import java.util.*;
import javax.persistence.*;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlIDREF;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
/**
* An accepted potential taxon defined by the combination of a Name and a sec reference
* @version 1.0
* @created 08-Nov-2007 13:06:56
*/
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "taxonomicParentCache",
+ "taxonomicChildrenCount",
+ "synonymRelations",
+ "relationsFromThisTaxon",
+ "relationsToThisTaxon",
+ "descriptions"
+})
@XmlRootElement(name = "Taxon")
@Entity
public class Taxon extends TaxonBase implements Iterable<Taxon>, IRelated<RelationshipBase>{
+
static Logger logger = Logger.getLogger(Taxon.class);
+
+ @XmlElementWrapper(name = "Descriptions")
+ @XmlElement(name = "Description")
private Set<TaxonDescription> descriptions = new HashSet<TaxonDescription>();
+
// all related synonyms
- @XmlTransient
- // Cycle detected
+ @XmlElementWrapper(name = "SynonymRelations")
+ @XmlElement(name = "SynonymRelationship")
+ // FIXME: Remove @XmlIDREF.
+ // FIXME: "unable to marshal type "Synonym" as an element because it is missing an @XmlRootElement annotation"
+ @XmlIDREF
+ @XmlSchemaType(name = "IDREF")
private Set<SynonymRelationship> synonymRelations = new HashSet<SynonymRelationship>();
+
// all taxa relations with rel.fromTaxon==this
- @XmlTransient
+ @XmlElementWrapper(name = "RelationsFromThisTaxon")
+ @XmlElement(name = "FromThisTaxonRelationship")
+ // FIXME: Remove @XmlIDREF. Fix stack overflow.
+ @XmlIDREF
+ @XmlSchemaType(name = "IDREF")
private Set<TaxonRelationship> relationsFromThisTaxon = new HashSet<TaxonRelationship>();
+
// all taxa relations with rel.toTaxon==this
- @XmlTransient
+ @XmlElementWrapper(name = "RelationsToThisTaxon")
+ @XmlElement(name = "ToThisTaxonRelationship")
+ // FIXME: Remove @XmlIDREF. Fix stck overflow.
+ @XmlIDREF
+ @XmlSchemaType(name = "IDREF")
private Set<TaxonRelationship> relationsToThisTaxon = new HashSet<TaxonRelationship>();
+
// shortcut to the taxonomicIncluded (parent) taxon. Managed by the taxonRelations setter
+ @XmlElement(name = "TaxonomicParentCache")
private Taxon taxonomicParentCache;
+
//cached number of taxonomic children
+ @XmlElement(name = "TaxonomicChildrenCount")
private int taxonomicChildrenCount;
private static Method methodDescriptionSetTaxon;
import java.lang.reflect.Method;
import javax.persistence.*;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlIDREF;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
/**
* Upmost abstract class for the use of a taxon name by a reference either
* @version 1.0
* @created 08-Nov-2007 13:06:56
*/
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "TaxonBase", propOrder = {
+ "name",
+ "sec"
+})
@Entity
@Table(appliesTo="TaxonBase", indexes = { @Index(name = "taxonBaseTitleCacheIndex", columnNames = { "titleCache" }) })
public abstract class TaxonBase extends IdentifiableEntity {
+
static Logger logger = Logger.getLogger(TaxonBase.class);
private static Method methodTaxonNameAddTaxonBase;
}
//The assignment to the Taxon or to the Synonym class is not definitive
+ @XmlAttribute(name = "isDoubtful")
private boolean isDoubtful;
- @XmlTransient
+
+ @XmlElement(name = "Name", required = true)
+ @XmlIDREF
+ @XmlSchemaType(name = "IDREF")
private TaxonNameBase name;
+
// The concept reference
+ @XmlElement(name = "Sec")
+ @XmlIDREF
+ @XmlSchemaType(name = "IDREF")
private ReferenceBase sec;
@Override
import org.apache.log4j.Logger;
import javax.persistence.*;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlIDREF;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
/**
* @author m.doering
* @version 1.0
* @created 08-Nov-2007 13:06:58
*/
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "")
+@XmlRootElement(name = "TaxonRelationship")
@Entity
public class TaxonRelationship extends RelationshipBase<Taxon, Taxon, TaxonRelationshipType> {
+
static private final Logger logger = Logger.getLogger(TaxonRelationship.class);
+
+ @XmlElement(name = "Type")
+ @XmlIDREF
+ @XmlSchemaType(name = "IDREF")
private TaxonRelationshipType type;
//for hibernate, don't use
import eu.etaxonomy.cdm.model.common.RelationshipTermBase;
import org.apache.log4j.Logger;
import javax.persistence.*;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
import java.util.UUID;
* @created 08-Nov-2007 13:06:17
* http://rs.tdwg.org/ontology/voc/TaxonConcept#TaxonRelationshipTerm
*/
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "TaxonRelationshipType")
@Entity
public class TaxonRelationshipType extends RelationshipTermBase<TaxonRelationshipType> {
+
static Logger logger = Logger.getLogger(TaxonRelationshipType.class);
private static final UUID uuidTaxonomicallyIncludedIn = UUID.fromString("d13fecdf-eb44-4dd7-9244-26679c05df1c");