From 842deb1af7e728ee84b0b98ff674c9a10fb74673 Mon Sep 17 00:00:00 2001
From: Kai Brassel <mail@khbrassel.de>
Date: Sun, 14 Mar 2021 21:45:07 +0100
Subject: [PATCH] Custom conversion methods between String and Quantities were
 missing

---
 de.hftstuttgart.cityunits.model/model/Quantities.genmodel | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/de.hftstuttgart.cityunits.model/model/Quantities.genmodel b/de.hftstuttgart.cityunits.model/model/Quantities.genmodel
index 1b3b361..2571119 100644
--- a/de.hftstuttgart.cityunits.model/model/Quantities.genmodel
+++ b/de.hftstuttgart.cityunits.model/model/Quantities.genmodel
@@ -7,7 +7,9 @@
   <foreignModel>Quantities.ecore</foreignModel>
   <genPackages prefix="Quantities" basePackage="de.hftstuttgart.cityunits.model" disposableProviderFactory="true"
       ecorePackage="Quantities.ecore#/">
-    <genDataTypes ecoreDataType="Quantities.ecore#//QuantityDouble"/>
-    <genDataTypes ecoreDataType="Quantities.ecore#//QuantityLong"/>
+    <genDataTypes ecoreDataType="Quantities.ecore#//QuantityDouble" create="return de.hftstuttgart.units.NullableQuantity.create(it);"
+        convert="return it == null ? null : it.toString();"/>
+    <genDataTypes ecoreDataType="Quantities.ecore#//QuantityLong" create="return de.hftstuttgart.units.NullableQuantity.create(it);"
+        convert="return it == null ? null : it.toString();"/>
   </genPackages>
 </genmodel:GenModel>
-- 
GitLab