diff options
author | Ralf Mollik | 2018-07-09 14:17:59 +0000 |
---|---|---|
committer | Ralf Mollik | 2018-07-09 14:17:59 +0000 |
commit | 5018ff64824480afa282fdab834ee00bced0cb43 (patch) | |
tree | 6fae8cbdd42654aebaf51fc86b70f1c9a0a45356 | |
parent | 1398c3455df986baec8a6199b04ee12ab04a5b4c (diff) | |
download | org.eclipse.osbp.dsl-5018ff64824480afa282fdab834ee00bced0cb43.tar.gz org.eclipse.osbp.dsl-5018ff64824480afa282fdab834ee00bced0cb43.tar.xz org.eclipse.osbp.dsl-5018ff64824480afa282fdab834ee00bced0cb43.zip |
catch up with branch development
Signed-off-by: Ralf Mollik <ramollik@compex-commerce.com>
6 files changed, 16 insertions, 8 deletions
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 @@ public abstract class AbstractDTOService<DTO, ENTITY> // 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 @@ public abstract class AbstractDTOService<DTO, ENTITY> // 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 @@ class AnnotationCompiler extends org.eclipse.osbp.dsl.common.xtext.jvmmodel.Anno } } 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 @@ class AnnotationCompiler extends org.eclipse.osbp.dsl.common.xtext.jvmmodel.Anno 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 @@ class AnnotationCompiler extends org.eclipse.osbp.dsl.common.xtext.jvmmodel.Anno 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 |