Split table DefinedTermBase_DefinedTermBase into three tables. Fixed saving of NamedA...
authora.babadshanjan <a.babadshanjan@localhost>
Tue, 30 Sep 2008 12:27:36 +0000 (12:27 +0000)
committera.babadshanjan <a.babadshanjan@localhost>
Tue, 30 Sep 2008 12:27:36 +0000 (12:27 +0000)
Added one continent to WaterbodyOrCountry.csv. Cleaned up CdmExporter refactoring.

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/Feature.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/StatisticalMeasure.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/location/NamedArea.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/location/WaterbodyOrCountry.java
cdmlib-model/src/main/resources/terms/WaterbodyOrCountry.csv

index a2e001c52b335be11fcb3cae46f634ca9a5b9484..059d7715475a029d8907d1c4651ff47397943ae9 100644 (file)
@@ -16,7 +16,10 @@ import java.util.Set;
 import java.util.UUID;
 
 import javax.persistence.Entity;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
 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;
@@ -27,6 +30,8 @@ import javax.xml.bind.annotation.XmlSchemaType;
 import javax.xml.bind.annotation.XmlType;
 
 import org.apache.log4j.Logger;
+import org.hibernate.annotations.Cascade;
+import org.hibernate.annotations.CascadeType;
 
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
 import eu.etaxonomy.cdm.model.common.ILoadableTerm;
@@ -339,7 +344,11 @@ public class Feature extends DefinedTermBase {
         * Returns the set of {@link StatisticalMeasure statistical measures} recommended to be used
         * in case of {@link QuantitativeData quantitative data} with <i>this</i> feature.
         */
-       @OneToMany
+       @ManyToMany
+    @JoinTable(
+            name="DefinedTermBase_StatisticalMeasure"
+        )
+       @Cascade({CascadeType.SAVE_UPDATE})
        public Set<StatisticalMeasure> getRecommendedStatisticalMeasures() {
                return recommendedStatisticalMeasures;
        }
index 661cd7fd590ffd7fbd55843b12b4329e099bb472..8c39a0cc0b31550a53346321dd43ca8d705df815 100644 (file)
@@ -27,7 +27,7 @@ import javax.persistence.*;
  */
 @Entity
 public class StatisticalMeasure extends DefinedTermBase {
-       static Logger logger = Logger.getLogger(StatisticalMeasure.class);
+       private static final Logger logger = Logger.getLogger(StatisticalMeasure.class);
 
        // ************* CONSTRUCTORS *************/    
        /** 
index 2d5580a6d6782a546f82d47911e694b947989043..f3ca66a9f913f27614b3a26aad68cbbacb4360a2 100644 (file)
@@ -138,8 +138,10 @@ public class NamedArea extends OrderedTermBase<NamedArea> {
                this.shape = shape;
        }
 
-
-       @ManyToMany
+    @ManyToMany
+    @JoinTable(
+        name="DefinedTermBase_WaterbodyOrCountry"
+    )
        @Cascade({CascadeType.SAVE_UPDATE})
        public Set<WaterbodyOrCountry> getWaterbodiesOrCountries() {
                return waterbodiesOrCountries;
index 7cff502aeddf283c8ce0f96879a8b4cc1501d8c7..56582eb44d334426bac070dcc5f3c9af7c841eb3 100644 (file)
@@ -606,8 +606,10 @@ uuidPersianGulf
                super(term, label, labelAbbrev);
        }
 
-       
-       @OneToMany
+       @ManyToMany
+    @JoinTable(
+        name="DefinedTermBase_Continent"
+    )
        @Cascade({CascadeType.SAVE_UPDATE})
        public Set<Continent> getContinents() {
                return continents;
index d1eece68c38a8796ee9c2cc3656b25e918332e2a..3555335a249e0bd11b94c1d74e518ba5fe60cf66 100644 (file)
@@ -1,6 +1,6 @@
 "006b1870-7347-4624-990f-e5ed78484a1a",,"WaterbodyOrCountry","WaterbodyOrCountry",\r
 "974ce01a-5bce-4be8-b728-a46869354960",,"AFG","Afghanistan","AF","[]",\r
-"238a6a93-8857-4fd6-af9e-6437c90817ac",,"ALB","Albania, People's Socialist Republic of","AL","[]",\r
+"238a6a93-8857-4fd6-af9e-6437c90817ac",,"ALB","Albania, People's Socialist Republic of","AL",[3b69f979-408c-4080-b573-0ad78a315610],\r
 "a14b38ac-e963-4c1a-85c2-de1f17f8c72a",,"DZA","Algeria, People's Democratic Republic of","DZ","[]",\r
 "4a071803-88aa-4367-9707-bb1f24ad4386",,"ASM","American Samoa","AS","[]",\r
 "7efd738f-33a1-4969-9d49-552571ffe935",,"AND","Andorra, Principality of","AD","[]",\r