开发者

How to generate ORM.XML mapping files from annotations?

开发者 https://www.devze.com 2023-01-17 23:24 出处:网络
At work, we design solutions for rather big entities in the financi开发者_如何学运维al services area, and we prefer to have our deployment mappings in XML, since it\'s easy to change without having to

At work, we design solutions for rather big entities in the financi开发者_如何学运维al services area, and we prefer to have our deployment mappings in XML, since it's easy to change without having to recompile.

We would like to do our development using annotations and generate from them the orm.xml mapping files. I found this proof of concept annotation processor, and something like that is what I'm looking for, but something that has support for most JPA annotations.

We're using WebSphere for development so we would prefer something that considers the OpenJPA implementation


Here is a possible approach:

  1. use the annotated classes to generate the database schema
  2. use OpenJPA's SchemaTool to reverse engineer the database schema into their XML schema file
  3. use OpenJPA's ReverseMappingTool to generate XML mapping files from the XML schema file
0

精彩评论

暂无评论...
验证码 换一张
取 消