JPA java code generation

后端 未结 10 2021
囚心锁ツ
囚心锁ツ 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 02:53

    Project lombok seems allowing you to generate basic named queries, this is another approach using annotations and code generation at compile time.

    See:

    • http://groups.google.com/group/project-lombok/browse_thread/thread/a8c01b2226c081cb
    • http://projectlombok.org

    A guy over the hibernate forum seems using a traditionnal code generation approach with Hibernate Tools : https://forum.hibernate.org/viewtopic.php?f=9&t=962223&p=2315766&hilit=named+queries+generate#p2315766

    I agree with cletus on the point that you cannot generate all named queries, but I guess we can imagine generating basic named queries such finders based on one or several fields of the object.

提交回复
热议问题