The JPA spec. defines the JPA annotation in the javax.persistence package. Hibernate not only implements JPA spec , but extends it to adds more features . So , hibernate creates their own annotations which just extend the JPA annotation with the Hibernate features , and put these annotation inside the package org.hibernate.annotations

If there are no Hibernate specified features added for that JPA annotation (eg @OneToMany and @ManyToOne) , Hibernate will not make that annotation in their org.hibernate.annotations package and you have to use these annotation from javax.persistence according to the JPA specification.

Normally ,people will use JPA annotations until they come across a situation that requires to use hibernate features.

In one word: if you want to use hibernate with annotation, you must use some annotations in the javax.persistence package.
 
Extends:
    1,JPA(Java Persistence API)是Sun官方提出的Java持久化规范。它为Java开发人员提供了一种对象/关系映射工具来管理Java应用中的关系数据。,而Hibernate是它的一种实现。除了Hibernate,还有EclipseLink(曾经的toplink),OpenJPA等可供选择,所以使用Jpa的一个好处是,可以更换实现而不必改动太多代码。

2,Hibernate作为JPA的一种实现,jpa的注解已经是hibernate的核心,hibernate只提供了一些补充,而不是两套注解。hibernate对jpa的支持够足量,在使用hibernate注解建议使用jpa。

最新文章

  1. Daily Scrum02 12.17
  2. Office2010安装错误1402问题(我安装成功了)
  3. Asp.net Core基于MVC框架实现PostgreSQL操作
  4. Python~第三方模块
  5. Activiti6.0 安装出错 log4j:ERROR setFile(null,true) call failed.
  6. HDU 3687 National Day Parade (暴力)
  7. struts2.1笔记01:MVC框架思想浅层理解
  8. c语言中的#ifndef、#def、#endif等宏是什么意思
  9. 浅析ArrayList,LinkedList的执行效率
  10. 开源Math.NET基础数学类库使用(09)相关数论函数使用
  11. leetcode 第41题 Trapping Rain Water
  12. IE6里面display:inlineblock使得块元素成行排列,没用
  13. 让表格table呈现边框,不用给tr、td加边框的写法
  14. 关于JAVA IO流的学习
  15. HDU2057 A + B Again
  16. 【深度学习系列】手写数字识别卷积神经--卷积神经网络CNN原理详解(一)
  17. MySQL学习(十二)
  18. 查看文件 ls -lh
  19. github使用记录
  20. 【linux】crontab无效解决办法

热门文章

  1. [转帖]nginx配置ssl证书实现https访问
  2. getBoundingClientRect()方法
  3. 数据检索grep
  4. linux系统设置允许密码登录
  5. idea jar 中没有主清单属性
  6. 【问题】【编程环境】fatal error: security/pam_appl.h
  7. T100——英文版凭证报表
  8. Scalar Queries CodeForces - 1167F (计数,树状数组)
  9. 怎样使用 v-on 指令?
  10. MVC4学习要点记一