没有合适的资源?快使用搜索试试~ 我知道了~
首页hibernate_reference_anotation 3.5.0-final pdf
hibernate_reference_anotation 3.5.0-final pdf
3星 · 超过75%的资源 需积分: 10 20 下载量 71 浏览量
更新于2023-07-11
收藏 501KB PDF 举报
hibernate anotaion jpa 3.5.0-final pdf hibernate anotaion jpa 3.5.0-final pdf
资源详情
资源推荐
Hibernate Annotations
Reference Guide
3.5.0-Final
by Emmanuel Bernard
iii
Preface ............................................................................................................................. v
1. Setting up an annotations project ............................................................................... 1
1.1. Requirements ..................................................................................................... 1
1.2. Configuration ...................................................................................................... 1
1.3. Properties ........................................................................................................... 4
1.4. Logging .............................................................................................................. 4
2. Mapping Entities .......................................................................................................... 7
2.1. Intro ................................................................................................................... 7
2.2. Mapping with JPA (Java Persistence Annotations) ................................................ 7
2.2.1. Marking a POJO as persistent entity ......................................................... 7
2.2.2. Mapping simple properties ........................................................................ 9
2.2.3. Mapping identifier properties ................................................................... 15
2.2.4. Mapping inheritance ............................................................................... 24
2.2.5. Mapping entity associations/relationships ................................................. 28
2.2.6. Mapping composite primary keys and foreign keys to composite primary
keys ................................................................................................................ 43
2.2.7. Mapping secondary tables ...................................................................... 45
2.2.8. Caching entities ..................................................................................... 45
2.3. Mapping Queries .............................................................................................. 47
2.3.1. Mapping JP-QL/HQL queries .................................................................. 47
2.3.2. Mapping native queries .......................................................................... 48
2.4. Hibernate Annotation Extensions ....................................................................... 52
2.4.1. Entity ..................................................................................................... 52
2.4.2. Identifier ................................................................................................ 55
2.4.3. Property ................................................................................................. 56
2.4.4. Inheritance ............................................................................................. 60
2.4.5. Single Association related annotations ..................................................... 60
2.4.6. Collection related annotations ................................................................. 63
2.4.7. Cascade ................................................................................................ 66
2.4.8. Filters .................................................................................................... 67
2.4.9. Queries .................................................................................................. 68
2.4.10. Custom SQL for CRUD operations ........................................................ 69
2.4.11. Tuplizer ................................................................................................ 70
2.4.12. Fetch profiles ....................................................................................... 71
3. Overriding metadata through XML ............................................................................. 73
3.1. Principles .......................................................................................................... 73
3.1.1. Global level metadata ............................................................................. 73
3.1.2. Entity level metadata .............................................................................. 74
3.1.3. Property level metadata .......................................................................... 76
3.1.4. Association level metadata ..................................................................... 77
4. Additional modules .................................................................................................... 79
4.1. Bean Validation ................................................................................................ 79
4.1.1. Adding Bean Validation .......................................................................... 79
4.1.2. Configuration .......................................................................................... 79
Hibernate Annotations
iv
4.1.3. Catching violations ................................................................................. 81
4.1.4. Database schema .................................................................................. 81
4.2. Hibernate Validator 3 ........................................................................................ 82
4.2.1. Description ............................................................................................. 82
4.2.2. Integration with Hibernate Annotations ..................................................... 82
4.3. Hibernate Search .............................................................................................. 83
4.3.1. Description ............................................................................................. 83
4.3.2. Integration with Hibernate Annotations ..................................................... 83
v
Preface
Hibernate, like all other object/relational mapping tools, requires metadata that governs the
transformation of data from one representation to the other. Hibernate Annotations provides
annotation-based mapping metadata.
The JPA specification recognizes the interest and the success of the transparent object/
relational mapping paradigm. It standardizes the basic APIs and the metadata needed for any
object/relational persistence mechanism. Hibernate EntityManager implements the programming
interfaces and lifecycle rules as defined by the JPA persistence specification and together with
Hibernate Annotations offers a complete (and standalone) JPA persistence solution on top of the
mature Hibernate Core. You may use a combination of all three together, annotations without
JPA programming interfaces and lifecycle, or even pure native Hibernate Core, depending on the
business and technical needs of your project. At all time you can fall back to Hibernate native
APIs, or if required, even to native JDBC and SQL.
This release of Hibernate Annotations is based on the final release of the JPA 2 specification (aka
JSR-317 [http://jcp.org/en/jsr/detail?id=317]) and supports all its features (including the optional
ones). Hibernate specific features and extensions are also available through unstandardized,
Hibernate specific annotations.
If you are moving from previous Hibernate Annotations versions, please have a look at Java
Persistence migration guide [http://www.hibernate.org/398.html].
剩余89页未读,继续阅读
寒城子
- 粉丝: 0
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 保险服务门店新年工作计划PPT.pptx
- 车辆安全工作计划PPT.pptx
- ipqc工作总结PPT.pptx
- 车间员工上半年工作总结PPT.pptx
- 保险公司员工的工作总结PPT.pptx
- 报价工作总结PPT.pptx
- 冲压车间实习工作总结PPT.pptx
- ktv周工作总结PPT.pptx
- 保育院总务工作计划PPT.pptx
- xx年度现代教育技术工作总结PPT.pptx
- 出纳的年终总结PPT.pptx
- 贝贝班班级工作计划PPT.pptx
- 变电值班员技术个人工作总结PPT.pptx
- 大学生读书活动策划书PPT.pptx
- 财务出纳月工作总结PPT.pptx
- 大学生“三支一扶”服务期满工作总结(2)PPT.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功