Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Taal2012-08-23 10:09:28 -0400
committerMartin Taal2012-08-23 10:09:28 -0400
commite3dbb497886739d598a2f72feb2beb050c336951 (patch)
tree41f39e5a6b5ef48920121dda96ce37db5811d0a6 /generator/org.eclipse.emf.texo.orm
parent8b617b5a917459ef64e6b9d47ebe1fb04f1ad072 (diff)
downloadorg.eclipse.emf.texo-e3dbb497886739d598a2f72feb2beb050c336951.tar.gz
org.eclipse.emf.texo-e3dbb497886739d598a2f72feb2beb050c336951.tar.xz
org.eclipse.emf.texo-e3dbb497886739d598a2f72feb2beb050c336951.zip
Fixes issue 386923
Diffstat (limited to 'generator/org.eclipse.emf.texo.orm')
-rw-r--r--generator/org.eclipse.emf.texo.orm/src/org/eclipse/emf/texo/orm/annotator/ORMJavaAnnotationGenerator.java16
1 files changed, 14 insertions, 2 deletions
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 f2fe3d16..74325f15 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
@@ -56,6 +56,7 @@ public class ORMJavaAnnotationGenerator {
private List<EClassifier> eclipseLinkEClassifiers = new ArrayList<EClassifier>();
private List<String> classFeatureNames = new ArrayList<String>();
private Map<Class<?>, String> enumTypeNames = new HashMap<Class<?>, String>();
+ private Map<String, String> renames = new HashMap<String, String>();
private Map<EStructuralFeature, String> eFeatureAnnotationMapping = new HashMap<EStructuralFeature, String>();
public ORMJavaAnnotationGenerator() {
@@ -109,6 +110,9 @@ public class ORMJavaAnnotationGenerator {
"org.eclipse.persistence.annotations.Convert");
eFeatureAnnotationMapping.put(OrmPackage.eINSTANCE.getBasic_Convert(),
"org.eclipse.persistence.annotations.Convert");
+
+ renames.put("entityResults", "entities");
+ renames.put("columnResults", "columns");
}
/**
@@ -154,7 +158,7 @@ public class ORMJavaAnnotationGenerator {
continue;
}
- // for now assume that the
+ // for now assume that the value is a primitive
if (eFeatureAnnotationMapping.containsKey(eFeature)) {
if (value instanceof String) {
separateAnnotation.append("@" + eFeatureAnnotationMapping.get(eFeature) + "(\"" + value + "\")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -241,7 +245,15 @@ public class ORMJavaAnnotationGenerator {
if (separateAnnotation.length() > 0) {
sb.append("\n" + separateAnnotation); //$NON-NLS-1$
}
- return sb.toString();
+
+ String resultStr = sb.toString();
+ for (String key : renames.keySet()) {
+ if (resultStr.contains(key)) {
+ resultStr = resultStr.replace(key, renames.get(key));
+ }
+ }
+
+ return resultStr;
}
private String pluralize(String value) {

Back to the top