May I know can the Eclipse plugin Hibernate tool use to generate JPA entity @entity? The Java files that generated look like below and not 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 {
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With