Freewind
Freewind

Reputation: 198198

Why jpa and hibernate both have "Entity" and "Table" annotations?

I use hibernate 3.6, and found there are such annotations:

javax.persistence.Entity
org.hibernate.annotations.Entity

javax.persistence.Table
org.hibernate.annotations.Table

Why hibernate provides its own? Is it a replacement of jpa one, or just a complement? Should(Can) I use them both together, like:

@javax.persistence.Entity
@org.hibernate.annotations.Entity
public class User {}

Upvotes: 1

Views: 2909

Answers (1)

teclis
teclis

Reputation: 603

org.hibernate.annotations.Entity extends javax.persistence.Entity with hibernate features.

see: http://docs.jboss.org/hibernate/core/3.6/javadocs/org/hibernate/annotations/Entity.html

Upvotes: 3

Related Questions