vedamen wrote:
I want to generate the xml mapping files from annotated entity classes.
I checked hibernate tools, but I was only able to generate the database tables from annotated classes or hbm.xml files and the other way around.
Everything that hibernate tools can generate from hbm.xml and/or db is also available for annotations.
you just need use an <annotationconfiguration> or <jpaconfiguration> from Ant (or select similar option in eclipse)
Quote:
1. Is there a way to generate the hbm.xml mapping files from annotated entity classes?
Yes - there is no difference on how you would do this from a db, hbm.xml or annotations...just need to start with the right Configuration type and selecte the hbm2hbmxml exporter.
Quote:
2. Does anybody know of a tool that can generate EJB3 xml mapping files from annotated EJB3 entities?
No, but is possible to extend hibernate tools to do that (patches welcome).
do know that orm.xml cannot express all the things that hbm.xml and/or hibernate annotations can map.