Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Taal2013-02-20 14:31:29 -0500
committerMartin Taal2013-02-20 14:31:29 -0500
commitdb0d5d9fdc3ccf72f15c207ad2135337f02ccbdb (patch)
treef3c8692333e75370f805eac8d96e58225bf8bdca /generator/org.eclipse.emf.texo.orm
parent0e54f934965c17c1e532e15b02cc06aa854b17f6 (diff)
downloadorg.eclipse.emf.texo-db0d5d9fdc3ccf72f15c207ad2135337f02ccbdb.tar.gz
org.eclipse.emf.texo-db0d5d9fdc3ccf72f15c207ad2135337f02ccbdb.tar.xz
org.eclipse.emf.texo-db0d5d9fdc3ccf72f15c207ad2135337f02ccbdb.zip
Fixes issue [401284] - The inheritance strategy is not set in the generated orm.xml
Diffstat (limited to 'generator/org.eclipse.emf.texo.orm')
-rwxr-xr-xgenerator/org.eclipse.emf.texo.orm/src/org/eclipse/emf/texo/orm/annotator/EClassORMAnnotator.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/generator/org.eclipse.emf.texo.orm/src/org/eclipse/emf/texo/orm/annotator/EClassORMAnnotator.java b/generator/org.eclipse.emf.texo.orm/src/org/eclipse/emf/texo/orm/annotator/EClassORMAnnotator.java
index 3535b6d6..570585ee 100755
--- a/generator/org.eclipse.emf.texo.orm/src/org/eclipse/emf/texo/orm/annotator/EClassORMAnnotator.java
+++ b/generator/org.eclipse.emf.texo.orm/src/org/eclipse/emf/texo/orm/annotator/EClassORMAnnotator.java
@@ -80,16 +80,19 @@ public class EClassORMAnnotator extends ETypeElementORMAnnotator implements Anno
return;
}
+ // only add entity if not embeddable
+ final Embeddable embeddable = annotation.getEmbeddable();
+ if (embeddable == null && annotation.getEntity() == null) {
+ annotation.setEntity(OrmFactory.eINSTANCE.createEntity());
+ }
+
// set the inheritance mapping, copy the annotation from epackage level
if (isRoot(annotation) && annotation.getInheritance() == null && ePackageAnnotation.getInheritance() != null
&& ePackageAnnotation.getInheritance().isSetStrategy()) {
annotation.setInheritance(EcoreUtil.copy(ePackageAnnotation.getInheritance()));
}
-
- // only add entity if not embeddable
- final Embeddable embeddable = annotation.getEmbeddable();
- if (embeddable == null && annotation.getEntity() == null) {
- annotation.setEntity(OrmFactory.eINSTANCE.createEntity());
+ if (annotation.getInheritance() != null && annotation.getEntity() != null) {
+ annotation.getEntity().setInheritance(EcoreUtil.copy(annotation.getInheritance()));
}
if (ORMMappingOptions.getDefaultOptions().isTestRun()) {

Back to the top