Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Taal2015-08-03 10:24:21 -0400
committerMartin Taal2015-08-03 10:24:21 -0400
commit43dc2bac2647fd9af9441e981de584ae606515d3 (patch)
tree8dbc68282b8cdbd40103677fff140a7121bc2845 /generator/org.eclipse.emf.texo.orm
parent5c8d5fef8ff5e89e18fa88692241cdc27cbc84fe (diff)
downloadorg.eclipse.emf.texo-43dc2bac2647fd9af9441e981de584ae606515d3.tar.gz
org.eclipse.emf.texo-43dc2bac2647fd9af9441e981de584ae606515d3.tar.xz
org.eclipse.emf.texo-43dc2bac2647fd9af9441e981de584ae606515d3.zip
Solve issue with cascade type empty showing instead of detach
Diffstat (limited to 'generator/org.eclipse.emf.texo.orm')
-rwxr-xr-xgenerator/org.eclipse.emf.texo.orm/src/org/eclipse/emf/texo/orm/annotations/model/orm/impl/CascadeTypeImpl.java4
-rw-r--r--generator/org.eclipse.emf.texo.orm/src/org/eclipse/emf/texo/orm/annotator/ORMJavaAnnotationGenerator.java4
2 files changed, 7 insertions, 1 deletions
diff --git a/generator/org.eclipse.emf.texo.orm/src/org/eclipse/emf/texo/orm/annotations/model/orm/impl/CascadeTypeImpl.java b/generator/org.eclipse.emf.texo.orm/src/org/eclipse/emf/texo/orm/annotations/model/orm/impl/CascadeTypeImpl.java
index 5577f29d..14754635 100755
--- a/generator/org.eclipse.emf.texo.orm/src/org/eclipse/emf/texo/orm/annotations/model/orm/impl/CascadeTypeImpl.java
+++ b/generator/org.eclipse.emf.texo.orm/src/org/eclipse/emf/texo/orm/annotations/model/orm/impl/CascadeTypeImpl.java
@@ -586,6 +586,10 @@ public class CascadeTypeImpl extends BaseOrmAnnotationImpl implements CascadeTyp
sb.append("javax.persistence.CascadeType.ALL"); //$NON-NLS-1$
} else {
boolean addComma = false;
+ if (getCascadeDetach() != null) {
+ sb.append("javax.persistence.CascadeType.DETACH"); //$NON-NLS-1$
+ addComma = true;
+ }
if (getCascadeMerge() != null) {
sb.append("javax.persistence.CascadeType.MERGE"); //$NON-NLS-1$
addComma = true;
diff --git a/generator/org.eclipse.emf.texo.orm/src/org/eclipse/emf/texo/orm/annotator/ORMJavaAnnotationGenerator.java b/generator/org.eclipse.emf.texo.orm/src/org/eclipse/emf/texo/orm/annotator/ORMJavaAnnotationGenerator.java
index 16deb5cc..cf79b5e8 100644
--- a/generator/org.eclipse.emf.texo.orm/src/org/eclipse/emf/texo/orm/annotator/ORMJavaAnnotationGenerator.java
+++ b/generator/org.eclipse.emf.texo.orm/src/org/eclipse/emf/texo/orm/annotator/ORMJavaAnnotationGenerator.java
@@ -210,7 +210,7 @@ public class ORMJavaAnnotationGenerator {
continue;
}
separateAnnotation
- .append("@" + getJavaPackage(eFeature.getEType()) + "." + pluralize(upperCaseFirst(getName(eFeature))) + "({"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ .append("@" + getJavaPackage(eFeature.getEType()) + "." + pluralize(upperCaseFirst(getName(eFeature))) + "({"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
boolean addArrayComma = false;
for (Object val : values) {
if (val instanceof BaseOrmAnnotation) {
@@ -263,6 +263,8 @@ public class ORMJavaAnnotationGenerator {
final String javaAnnotation = generateJavaAnnotation(eFeature, value, identifier);
if (javaAnnotation != null) {
sb.append(featureAnnotation.toString() + javaAnnotation);
+ } else {
+ addComma = false;
}
}
}

Back to the top