Added saveAll() to CdmEntityDaoBase.
import javax.persistence.Entity;
import javax.persistence.Transient;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
import org.apache.log4j.Logger;
* @created 08-Nov-2007 13:06:22
*/
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "OriginalSource", propOrder = {
+ "idInSource",
+ "idNamespace"
+})
+@XmlRootElement(name = "OriginalSource")
@Entity
public class OriginalSource extends ReferencedEntityBase implements Cloneable{
+
static Logger logger = Logger.getLogger(OriginalSource.class);
+
//The object's ID in the source, where the alternative string comes from
+ @XmlElement(name = "IdInSource")
private String idInSource;
+
+ @XmlElement(name = "IdNamespace")
private String idNamespace;
+
+ @XmlTransient
private IdentifiableEntity sourcedObj;
/**
import javax.persistence.MappedSuperclass;
import javax.persistence.OneToMany;
import javax.persistence.Transient;
+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.XmlType;
import org.apache.log4j.Logger;
import org.hibernate.annotations.Cascade;
import au.com.bytecode.opencsv.CSVWriter;
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "RelationshipTermBase", propOrder = {
+ "symmetric",
+ "transitive",
+ "inverseRepresentations"
+})
@XmlRootElement(name = "RelationshipTermBase")
@MappedSuperclass
public abstract class RelationshipTermBase<T extends RelationshipTermBase> extends OrderedTermBase<T> {
+
static Logger logger = Logger.getLogger(RelationshipTermBase.class);
+ @XmlElement(name = "Symmetric")
private boolean symmetric;
+
+ @XmlElement(name = "Transitive")
private boolean transitive;
+
+ @XmlElementWrapper(name = "InverseRepresentations")
+ @XmlElement(name = "InverseRepresentation")
+ @XmlIDREF
+ @XmlSchemaType(name = "IDREF")
private Set<Representation> inverseRepresentations = new HashSet();
public RelationshipTermBase() {
@XmlElementWrapper(name = "Representations")
@XmlElement(name = "Representation")
- @XmlIDREF
- @XmlSchemaType(name = "IDREF")
+// @XmlIDREF
+// @XmlSchemaType(name = "IDREF")
private Set<Representation> representations = new HashSet<Representation>();
public TermBase(){
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MediaRepresentation", propOrder = {
"mimeType",
- "suffix"
-// "mediaRepresentationParts"
+ "suffix",
+ "mediaRepresentationParts"
})
@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@XmlTransient
private Media media;
- @XmlTransient
- //FIXME: ArrayIndexOutOfBoundException during marshalling
-// @XmlElementWrapper(name = "MediaRepresentationParts")
-// @XmlElement(name = "MediaRepresentationPart", type = ArrayList.class)
-// @XmlElements({
-// @XmlElement(name = "AudioFile", namespace = "http://etaxonomy.eu/cdm/model/media/1.0", type = CategoricalData.class),
-// @XmlElement(name = "ImageFile", namespace = "http://etaxonomy.eu/cdm/model/media/1.0", type = CommonTaxonName.class),
-// @XmlElement(name = "MovieFile", namespace = "http://etaxonomy.eu/cdm/model/media/1.0", type = Distribution.class),
-// })
+ @XmlElementWrapper(name = "MediaRepresentationParts")
+ @XmlElements({
+ @XmlElement(name = "AudioFile", namespace = "http://etaxonomy.eu/cdm/model/media/1.0", type = AudioFile.class),
+ @XmlElement(name = "ImageFile", namespace = "http://etaxonomy.eu/cdm/model/media/1.0", type = ImageFile.class),
+ @XmlElement(name = "MovieFile", namespace = "http://etaxonomy.eu/cdm/model/media/1.0", type = MovieFile.class),
+ })
private List<MediaRepresentationPart> mediaRepresentationParts = new ArrayList<MediaRepresentationPart>();
- // Defining mediaRepresentationParts as ArrayList gives hibernate.AnnotationException
-
/**
* Factory method
* @return
@OneToMany(mappedBy="mediaRepresentation",fetch= FetchType.LAZY)
- @IndexColumn(name="sortIndex", base = 1)
+ @IndexColumn(name="sortIndex", base = 0)
@Cascade({CascadeType.SAVE_UPDATE, CascadeType.DELETE})
public List<MediaRepresentationPart> getParts(){
return this.mediaRepresentationParts;
*/\r
@XmlRootElement(name = "TypeDesignationBase")\r
@XmlType(name = "TypeDesignationBase", propOrder = {\r
-// "typifiedNames",\r
+ "typifiedNames",\r
"homotypicalGroup",\r
"isNotDesignated"\r
})\r
@XmlElement(name = "IsNotDesignated")\r
private boolean isNotDesignated;\r
\r
- // Need the bidirectional reference?\r
- @XmlTransient\r
-// @XmlElementWrapper(name = "TypifiedNames")\r
-// @XmlElement(name = "TypifiedName")\r
-// @XmlIDREF\r
-// @XmlSchemaType(name = "IDREF")\r
+ @XmlElementWrapper(name = "TypifiedNames")\r
+ @XmlElement(name = "TypifiedName")\r
+ @XmlIDREF\r
+ @XmlSchemaType(name = "IDREF")\r
+ // Need these references (bidirectional) to fill table TypeDesignationBase_TaxonNameBase\r
private Set<TaxonNameBase> typifiedNames = new HashSet<TaxonNameBase>();\r
\r
@XmlElement(name = "HomotypicalGroup")\r
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;
import org.apache.log4j.Logger;
private String pages;
@XmlElement(name = "InSeries")
+ @XmlIDREF
+ @XmlSchemaType(name = "IDREF")
private PrintSeries inSeries;
@XmlElement(name = "SeriesPart")