From 78c507b99169fa18a4b7b72b6ad7ce5a147f3d3d Mon Sep 17 00:00:00 2001
From: Timm Fitschen <t.fitschen@indiscale.com>
Date: Mon, 10 Aug 2020 12:59:09 +0200
Subject: [PATCH] FIX problems from last merge of dev

---
 .../transaction/RetrieveFullEntity.java       |  2 +-
 .../caosdb/server/entity/EntityInterface.java | 42 +++++++++----------
 .../server/entity/wrapper/EntityWrapper.java  |  1 +
 .../xml/PropertyToElementStrategyTest.java    |  2 +-
 4 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/src/main/java/caosdb/server/database/backend/transaction/RetrieveFullEntity.java b/src/main/java/caosdb/server/database/backend/transaction/RetrieveFullEntity.java
index a797807c..ad0d39e9 100644
--- a/src/main/java/caosdb/server/database/backend/transaction/RetrieveFullEntity.java
+++ b/src/main/java/caosdb/server/database/backend/transaction/RetrieveFullEntity.java
@@ -144,7 +144,7 @@ public class RetrieveFullEntity extends BackendTransaction {
               RetrieveEntity ref = new RetrieveEntity(value.getId());
               // recursion!  (Only for the matching selections)
               retrieveFullEntity(ref, getSubSelects(selections, propertyName));
-              value.setEntity(ref);
+              value.setEntity(ref, true);
             }
           }
         }
diff --git a/src/main/java/caosdb/server/entity/EntityInterface.java b/src/main/java/caosdb/server/entity/EntityInterface.java
index a666c968..4205111a 100644
--- a/src/main/java/caosdb/server/entity/EntityInterface.java
+++ b/src/main/java/caosdb/server/entity/EntityInterface.java
@@ -1,25 +1,25 @@
 /*
-* ** header v3.0
-* This file is a part of the CaosDB Project.
-*
-* Copyright (C) 2018 Research Group Biomedical Physics,
-* Max-Planck-Institute for Dynamics and Self-Organization Göttingen
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see <https://www.gnu.org/licenses/>.
-*
-* ** end header
-*/
+ * ** header v3.0
+ * This file is a part of the CaosDB Project.
+ *
+ * Copyright (C) 2018 Research Group Biomedical Physics,
+ * Max-Planck-Institute for Dynamics and Self-Organization Göttingen
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * ** end header
+ */
 package caosdb.server.entity;
 
 import caosdb.server.database.proto.SparseEntity;
diff --git a/src/main/java/caosdb/server/entity/wrapper/EntityWrapper.java b/src/main/java/caosdb/server/entity/wrapper/EntityWrapper.java
index 589fe937..f8d563de 100644
--- a/src/main/java/caosdb/server/entity/wrapper/EntityWrapper.java
+++ b/src/main/java/caosdb/server/entity/wrapper/EntityWrapper.java
@@ -574,6 +574,7 @@ public class EntityWrapper implements EntityInterface {
   @Override
   public String getIdVersion() {
     return this.entity.getIdVersion();
+  }
 
   @Override
   public void addToElement(Element element, SetFieldStrategy strategy) {
diff --git a/src/test/java/caosdb/server/entity/xml/PropertyToElementStrategyTest.java b/src/test/java/caosdb/server/entity/xml/PropertyToElementStrategyTest.java
index 7e0feec8..0d60ebd7 100644
--- a/src/test/java/caosdb/server/entity/xml/PropertyToElementStrategyTest.java
+++ b/src/test/java/caosdb/server/entity/xml/PropertyToElementStrategyTest.java
@@ -89,7 +89,7 @@ public class PropertyToElementStrategyTest {
     PropertyToElementStrategy strategy = new PropertyToElementStrategy();
     SetFieldStrategy setFieldStrategy = new SetFieldStrategy().addSelection(parse("height"));
     EntityInterface property = windowProperty;
-    ((ReferenceValue) property.getValue()).setEntity(window);
+    ((ReferenceValue) property.getValue()).setEntity(window, true);
     Element element = strategy.toElement(property, setFieldStrategy);
     assertEquals("Property", element.getName());
     assertEquals("2345", element.getAttributeValue("id"));
-- 
GitLab