Commit 1196c1ac authored by Martti Käärik's avatar Martti Käärik
Browse files

Added some missing annotations to mappings.

parent 956f5029
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -176,6 +176,17 @@ public class OpenAPI2TDLTranslatorNext extends AbstractTranslator {
					}
				}
			}
			for (PackageableElement e : theTdlPackage.getPackagedElement()) {
				if (e.eClass().equals(tdlPackage.eINSTANCE.getAnnotationType())
						&& e.getName().equals("MappingName")) {
					Annotation annot = tdlFactory.eINSTANCE.createAnnotation();
					annot.setKey((AnnotationType) e);
					annot.setValue("Java");
					// XXX disabled due to serialization problem
					// drmTarget.getAnnotation().add(annot);
					break;
				}
			}
		}
		

@@ -546,6 +557,7 @@ public class OpenAPI2TDLTranslatorNext extends AbstractTranslator {

				AnnotationType getterAnnotation = null;
				AnnotationType setterAnnotation = null;
				AnnotationType classAnnotation = null;
				if (javaPackage != null) {
					for (PackageableElement e : javaPackage.getPackagedElement()) {
						if (e.eClass().equals(tdlPackage.eINSTANCE.getAnnotationType())) {
@@ -553,6 +565,8 @@ public class OpenAPI2TDLTranslatorNext extends AbstractTranslator {
								getterAnnotation = (AnnotationType) e;
							if (e.getName().equals("JavaSetter"))
								setterAnnotation = (AnnotationType) e;
							if (e.getName().equals("JavaClass"))
								classAnnotation = (AnnotationType) e;
						}
					}
				}
@@ -573,6 +587,9 @@ public class OpenAPI2TDLTranslatorNext extends AbstractTranslator {
					eMapping.setMappableDataElement(type);
					eMapping.setElementURI(codeGen.getClassname());
					eMapping.setDataResourceMapping(resourceMapping);
					Annotation ca = tdlFactory.eINSTANCE.createAnnotation();
					ca.setKey(classAnnotation);
					eMapping.getAnnotation().add(ca);
					
					if (type instanceof EnumDataType) {