Can Hibernate tool generate JPA POJO?

こ雲淡風輕ζ 提交于 2019-12-04 05:16:54
Max Rydahl Andersen

You just need to choose EJB3 + Java5 as configuration options when generating.
Learn more: http://docs.jboss.org/tools/4.0.0.Final/en/hibernatetools/html_single/index.html#jpa_annotations

I believe you can generate Hibernate annotation code by using the Hibernate Perspective -> Add Configuration… and follow the steps of this tutorial .

I suspect the JPA annotated entity can be generated if you select JPA(jdk 1.5+) or Annotation (jdk 1.5+) in the following configuration .Please try it.

Yes, it can.

Hibernate Tools, which is now available as a part of JBoss Tools, can be used for generating JPA entities as well. In fact you need to select JPA option in Hibernate Configuration which is being used for your project.

Even better would be to start off your reverse code generation as a JPA Project. Then once the project is created switch over to the Hibernate Perspective to confirm the JPA annotations option is selected in the Hibernate Configuration settings.

Following tutorial has pictorial representation of various steps involved in creating a JPA Project in Eclipse. It then shows in the Appendix section how to edit the Hibernate Configuration as well.

http://www.javabrahman.com/j2ee/how-to-setup-a-jpa-project-with-a-data-connection-for-mysql-in-eclipse/

For me changing from hibernate version 5.4 to 5.2 worked while configuring. and do check use Java5 syntax and Generate EJB3 annotations while code generation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!