JPA java code generation

后端 未结 10 2028
囚心锁ツ
囚心锁ツ 2020-12-23 02:24

I am specifically looking for JPA code generation technique

First, what are all the project could generate JPA compliant code? (Eg. HibernateTools)

Second, I

10条回答
  •  星月不相逢
    2020-12-23 03:09

    Minuteproject is a generator tool and can generate JPA1/ JPA2 as well as hibernate ORM-like artifacts. It is based on reverse-engineering from the database. You can instruct the generator to apply convention for your java code that do not follow your DB convention, but the mapping will be correct. (Example strip DB name prefix; table starting with ADMIN_ such as ADMIN_ENVIRONMENT are Environment (w/out Admin) as java class) For the moment there 20+ conventions that help you reshape your model to be less DB look-and-feel by more Java-OO-friendly.

    Another interesting feature is updatable-code enabling to modify both the generated code and your model AND aht the next generation your modifications will be kept! The generator makes the merge.

    The templates are opensource and work with velocity, it is 'quite' easy to append a track to make specific one for your framework (ex security aspects... that are relevant to your organisation). You can scope your template to field level, entity (table or view), package (group of entities), model, application providing flexibility, and since the template of a track knows each other via metadata it is quite easy to reference then from other templates and to associate them by configuration with naming convention.

提交回复
热议问题