How to generate 'java code with annotations

2019-06-21 18:46发布

问题:

More precisely, I want to know, how one can model annotations into the ecore model definition. So that the generated java code would contain them. (For eg: hibernate persistence tags)

回答1:

I don't think you can to this out of the box. However, you could look into the parameters of the ".genmodel" file to see if you can tweak how annotations (EAnnotations) are being output to the files. The problem with code generation templates is that they are fixed, but maybe through some option in the genmodel you can control how annotations get written to files.



标签: eclipse-emf