org.hibernate.annotations vs. javax.persistence

Quite the opposite.

Hibernate is an implementation of the Java Persistence API, and where possible, you should use the standard annotations (in javax.persistence). This way, you could theoretically run your code on other JPA implementations.

Only when you need Hibernate-specific functionality should you use the Hibernate annotations.

The extra dependency is only on the JPA interface/annotation jar files and very light.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)