Can Hibernate tool generate JPA POJO?

cometta picture cometta · Jul 19, 2011 · Viewed 12.2k times · Source

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 {

Answer

Max Rydahl Andersen picture Max Rydahl Andersen · Jul 23, 2011

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