问题
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.
来源:https://stackoverflow.com/questions/4033246/how-to-generate-java-code-with-annotations-from-emf-model