catch up with branch development

Signed-off-by: Ralf Mollik <ramollik@compex-commerce.com>
diff --git a/org.eclipse.osbp.dsl.common.xtext/model/types.xcore b/org.eclipse.osbp.dsl.common.xtext/model/types.xcore
index 71f7024..fb54080 100644
--- a/org.eclipse.osbp.dsl.common.xtext/model/types.xcore
+++ b/org.eclipse.osbp.dsl.common.xtext/model/types.xcore
@@ -2,6 +2,8 @@
 @GenModel(modelName="Types")
 @GenModel(prefix="OSBPTypes")
 @GenModel(suppressEMFModelTags="true")
+@GenModel(loadInitialization="false")
+@GenModel(literalsInterface="true")
 @GenModel(copyrightText="Copyright (c) 2011, 2016 - Lunifera GmbH (Wien), Loetz GmbH&Co.KG (Heidelberg)
  All rights reserved. This program and the accompanying materials 
  are made available under the terms of the Eclipse Public License 2.0  
diff --git a/org.eclipse.osbp.dsl.dto.lib/src/org/eclipse/osbp/dsl/dto/lib/services/impl/AbstractDTOService.java b/org.eclipse.osbp.dsl.dto.lib/src/org/eclipse/osbp/dsl/dto/lib/services/impl/AbstractDTOService.java
index bcb0585..b3e58a2 100644
--- a/org.eclipse.osbp.dsl.dto.lib/src/org/eclipse/osbp/dsl/dto/lib/services/impl/AbstractDTOService.java
+++ b/org.eclipse.osbp.dsl.dto.lib/src/org/eclipse/osbp/dsl/dto/lib/services/impl/AbstractDTOService.java
@@ -358,7 +358,7 @@
 
 				// map dto to entity and persist
 				toEntityMapper.mapToEntity(dto, entity, entityMappingContext);
-				entity = txn.getEntityManager().merge(entity);
+				txn.getEntityManager().persist(entity);
 
 				if (entity != null && id instanceof Integer && ((Integer) id).intValue() == 0) {
 					Object newId = new EntityDelegate<ENTITY>(getEntityClass(), txn.getEntityManager(), PROP_MAX_COLLECTION_CONTENT)
@@ -1122,7 +1122,7 @@
 	
 				// map dto to entity and persist
 				toEntityMapper.mapToEntity(dto, entity, (MappingContext) entityMappingContext);
-				entity = txn.getEntityManager().merge(entity);
+				txn.getEntityManager().persist(entity);
 	
 				if (entity != null && id instanceof Integer && ((Integer) id).intValue() == 0) {
 					Object newId = new EntityDelegate<ENTITY>(getEntityClass(), txn.getEntityManager(), PROP_MAX_COLLECTION_CONTENT)
diff --git a/org.eclipse.osbp.dsl.dto.xtext/model/dto.xcore b/org.eclipse.osbp.dsl.dto.xtext/model/dto.xcore
index 49903db..f7a57aa 100644
--- a/org.eclipse.osbp.dsl.dto.xtext/model/dto.xcore
+++ b/org.eclipse.osbp.dsl.dto.xtext/model/dto.xcore
@@ -3,6 +3,8 @@
 @GenModel(prefix="OSBPDto")
 @GenModel(suppressEMFModelTags="true")
 @GenModel(runtimeVersion="2.9")
+@GenModel(loadInitialization="false")
+@GenModel(literalsInterface="true")
 @GenModel(copyrightText="Copyright (c) 2011, 2016 - Lunifera GmbH (Gross Enzersdorf), Loetz GmbH&Co.KG (Heidelberg)
  All rights reserved. This program and the accompanying materials 
  are made available under the terms of the Eclipse Public License 2.0  
diff --git a/org.eclipse.osbp.dsl.entity.xtext/model/entity.xcore b/org.eclipse.osbp.dsl.entity.xtext/model/entity.xcore
index e99b8c8..a79661d 100644
--- a/org.eclipse.osbp.dsl.entity.xtext/model/entity.xcore
+++ b/org.eclipse.osbp.dsl.entity.xtext/model/entity.xcore
@@ -2,6 +2,8 @@
 @GenModel(modelName="Entity")
 @GenModel(prefix="OSBPEntity")
 @GenModel(suppressEMFModelTags="true")
+@GenModel(loadInitialization="false")
+@GenModel(literalsInterface="true")
 @GenModel(copyrightText="Copyright (c) 2011, 2016 - Lunifera GmbH (Gross Enzersdorf), Loetz GmbH&Co.KG (Heidelberg)
  All rights reserved. This program and the accompanying materials 
  are made available under the terms of the Eclipse Public License 2.0  
diff --git a/org.eclipse.osbp.dsl.entity.xtext/src/org/eclipse/osbp/dsl/entity/xtext/jvmmodel/AnnotationCompiler.xtend b/org.eclipse.osbp.dsl.entity.xtext/src/org/eclipse/osbp/dsl/entity/xtext/jvmmodel/AnnotationCompiler.xtend
index db603ff..952d6a6 100644
--- a/org.eclipse.osbp.dsl.entity.xtext/src/org/eclipse/osbp/dsl/entity/xtext/jvmmodel/AnnotationCompiler.xtend
+++ b/org.eclipse.osbp.dsl.entity.xtext/src/org/eclipse/osbp/dsl/entity/xtext/jvmmodel/AnnotationCompiler.xtend
@@ -686,12 +686,12 @@
 			}
 		}
 		if (prop.cascading) {
-			val cascaded = newArrayList(CascadeType::MERGE, CascadeType::PERSIST, CascadeType::REMOVE)
+			val cascaded = newArrayList(CascadeType::PERSIST, CascadeType::REMOVE)
 			ann.addAnnAttr(prop, "cascade", cascaded.toArray(<Enum> newArrayOfSize(cascaded.length)))
 			ann.addAnnAttr(prop, "orphanRemoval", true)
 			ann.addAnnAttr(prop, "fetch", FetchType::EAGER)
 		} else {
-			val cascaded = newArrayList(CascadeType::MERGE, CascadeType::PERSIST)
+			val cascaded = newArrayList(CascadeType::PERSIST)
 				
 			ann.addAnnAttr(prop, "cascade", cascaded.toArray(<Enum> newArrayOfSize(cascaded.length)))
 			ann.addAnnAttr(prop, "orphanRemoval", false)
@@ -726,8 +726,8 @@
 		manyToOne.addAnnAttr(prop, "fetch", FetchType::LAZY)
 		val opposite = prop.resolvedOpposite
 		
-//		val cascaded = newArrayList(CascadeType::MERGE)
-//		manyToOne.addAnnAttr(prop, "cascade", cascaded.toArray(<Enum>newArrayOfSize(cascaded.length)))
+		val cascaded = newArrayList(CascadeType::PERSIST)
+		manyToOne.addAnnAttr(prop, "cascade", cascaded.toArray(<Enum>newArrayOfSize(cascaded.length)))
 		addAnno(prop, jvmAnnTarget, manyToOne)
 
 		val joinColumn = prop.toAnnotation(typeof(JoinColumn))
@@ -748,12 +748,12 @@
 			oneToOne.addAnnAttr(prop, "mappedBy", if(opposite.name != null) opposite.name else "")
 		}
 		if (prop.cascading) {
-			val cascaded = newArrayList(CascadeType::MERGE, CascadeType::PERSIST, CascadeType::REMOVE)
+			val cascaded = newArrayList(CascadeType::PERSIST, CascadeType::REMOVE)
 			oneToOne.addAnnAttr(prop, "cascade", cascaded.toArray(<Enum> newArrayOfSize(cascaded.length)))
 			oneToOne.addAnnAttr(prop, "orphanRemoval", true)
 			oneToOne.addAnnAttr(prop, "fetch", FetchType::EAGER)
 		} else {
-			val cascaded = newArrayList(CascadeType::MERGE, CascadeType::PERSIST)
+			val cascaded = newArrayList(CascadeType::PERSIST)
 			oneToOne.addAnnAttr(prop, "cascade", cascaded.toArray(<Enum> newArrayOfSize(cascaded.length)))
 			oneToOne.addAnnAttr(prop, "orphanRemoval", false)
 			oneToOne.addAnnAttr(prop, "fetch", FetchType::LAZY)
diff --git a/org.eclipse.osbp.dsl.services.xtext/model/services.xcore b/org.eclipse.osbp.dsl.services.xtext/model/services.xcore
index 90a1c20..2afbbcf 100644
--- a/org.eclipse.osbp.dsl.services.xtext/model/services.xcore
+++ b/org.eclipse.osbp.dsl.services.xtext/model/services.xcore
@@ -3,6 +3,8 @@
 @GenModel(prefix="OSBPService")
 @GenModel(suppressEMFModelTags="true")
 @GenModel(runtimeVersion="2.9")
+@GenModel(loadInitialization="false")
+@GenModel(literalsInterface="true")
 @GenModel(copyrightText="Copyright (c) 2011, 2016 - Lunifera GmbH (Wien), Loetz GmbH&Co.KG (Heidelberg)
  All rights reserved. This program and the accompanying materials 
  are made available under the terms of the Eclipse Public License 2.0