|
I tried this out on the examples/reversemapping/ example (after building it with "mvn package" and then modifying examples/reversemapping/build.xml to have GenerateAnnotations="true" and chaning examples/META-INF/persistence.xml to not list the orm.xml file and instead enumerate all the persistent classes), and it appears to work. Great job!
I haven't had a chance to review the patch in detail yet, but the annotations in the generated code look good to me. One thing I notice is that when I run against the aforementioned example, a "orm.xml" file is till generated. Do you know why this is? I haven't disabled orm.xml generation on purpose when annotations are enabled --iirc Patrick suggested that disabling it would be an option while we were discussing the feature. It can be disabled by setting metadata="none".
Sounds good. The only thing that is left is that we need documentation of the new arguments and their meanings in openjpa-project/src/doc/manual/ref_guide_mapping.xml . Once there is a patch in place, I don't see any reason not to commit it.
Doc update attached. I wasn't able to run docbook locally, so couldn't test the output.
Additional note: while updating the docs I realized there're quite a few options (not related to annotations) documented in ReverseMappingTool javadoc but did not make it to the manual. Oversight? I like it. Anyone have any issues with committing this patch?
I've gone ahead and committed the patch. Thanks for the feature imeplementation!
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Few implementation notes:
- The mechanism with which annotations are built follows xml metadata serialization scheme, in particular AnnotationPersistenceMetaDataSerializer and AnnotationPersistenceMappingSerializer closely resemble XMLPersistenceMetaDataSerializer and XMLPersistenceMappingSerializer. There's also a fair bit of code duplication among those classes, we might consider doing some refactoring there if you think it's worthwhile.
- I've tried to limit the number and impact of the changes on internal interfaces, which led to some rather awkward code at times --in particular how the annotation serializer gets invoked and its results are passed back to revmap tool. Any suggestions are welcome.
- I'm not sure about how to update the documentation, if anyone can point me in the right direction I can get it done.