Can a Hibernate tool generate JPA POJO?

Can I find out if the Hibernate tool of the Eclipse plugin can be used to create a JPA @entity object? The generated Java files look below, not the JPA:

package com.test.only.model; // Generated Jul 19, 2011 12:13:40 PM by Hibernate Tools 3.2.0.CR1 import java.math.BigDecimal; import java.util.Date; /** * Account generated by hbm2java */ public class Account implements java.io.Serializable { 
+6
source share
3 answers

You just need to select EJB3 + Java5 as configuration options when creating.
More details: http://docs.jboss.org/tools/4.0.0.Final/en/hibernatetools/html_single/index.html#jpa_annotations

+10
source

I believe that you can create the Hibernate annotation code using Hibernate Perspective Add Configuration… and follow the instructions in this tutorial .

I suspect that an annotated JPA object can be generated if you select JPA(jdk 1.5+) or Annotation (jdk 1.5+) in the following configuration. Try it out.

enter image description here

+2
source

Yes it is possible.

Hibernate Tools, which is now available as part of JBoss Tools, can be used to create JPA entities. In fact, you need to select the JPA option in the Hibernate configuration that is used for your project.

It would be better to start generating reverse coding as a JPA project. Then, once the project is created, switch to Hibernate Perspective to confirm that the JPA annotation option is selected in the hibernation configuration settings.

The following tutorial provides a graphical overview of the various steps involved in creating a JPA project in Eclipse. Then it also shows in the "Application" section how to edit the hibernation configuration.

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

+1
source

Source: https://habr.com/ru/post/893044/


All Articles