move children up to parent in code
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / taxon / TaxonNode.java
index f9953304335983b65dd3d1e835d535a4395c9983..8d8544aab996fbd3ed64673925bf30cae765f195 100644 (file)
@@ -116,20 +116,6 @@ public class TaxonNode
 //    @Cascade({CascadeType.SAVE_UPDATE, CascadeType.MERGE})
     private TaxonNode parent;
 
-    @XmlElement(name = "treeIndex")
-    @Column(length=255)
-    @Field(store = Store.YES, index = Index.YES, analyze = Analyze.NO)
-    private String treeIndex;
-
-    @XmlElement(name = "classification")
-    @XmlIDREF
-    @XmlSchemaType(name = "IDREF")
-    @ManyToOne(fetch = FetchType.LAZY)
-    @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE})
-//     TODO @NotNull // avoids creating a UNIQUE key for this field
-    @IndexedEmbedded(includeEmbeddedObjectId=true)
-    private Classification classification;
-
     @XmlElementWrapper(name = "childNodes")
     @XmlElement(name = "childNode")
     @XmlIDREF
@@ -143,15 +129,23 @@ public class TaxonNode
     //do not cascade
     private List<TaxonNode> childNodes = new ArrayList<>();
 
-    //TODO remove
-    //see https://dev.e-taxonomy.eu/redmine/issues/3722
-    //see https://dev.e-taxonomy.eu/redmine/issues/4200
-    @Transient
-    private Integer sortIndex = -1;
-
     @XmlElement(name = "countChildren")
     private int countChildren;
 
+    @XmlElement(name = "treeIndex")
+    @Column(length=255)
+    @Field(store = Store.YES, index = Index.YES, analyze = Analyze.NO)
+    private String treeIndex;
+
+    @XmlElement(name = "classification")
+    @XmlIDREF
+    @XmlSchemaType(name = "IDREF")
+    @ManyToOne(fetch = FetchType.LAZY)
+    @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE})
+//     TODO @NotNull // avoids creating a UNIQUE key for this field
+    @IndexedEmbedded(includeEmbeddedObjectId=true)
+    private Classification classification;
+
     @XmlElementWrapper(name = "agentRelations")
     @XmlElement(name = "agentRelation")
     @XmlIDREF