没有合适的资源?快使用搜索试试~ 我知道了~
首页spring-data-mongodb-parent-reference
spring-data-mongodb-parent-reference
5星 · 超过95%的资源 需积分: 10 12 下载量 153 浏览量
更新于2023-03-16
评论
收藏 388KB PDF 举报
这个就是最新的spring-data-mongodb-parent-referencePDF文档(2013.4.18),如果觉得舍不得分,可以去官网上下。虽然是英文版的,但是官方的文档就是详细,让javaer更方便,快捷的操纵MongoDB
资源详情
资源评论
资源推荐
Spring Data MongoDB - Reference Documentation
1.2.0.RELEASE
MarkPollack, ThomasRisberg, OliverGierke, CostinLeau, JonBrisbin
Copyright ©
Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee
for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
please define productname in your docbook file!
1.2.0.RELEASE
Spring Data MongoDB -
Reference Documentation ii
Table of Contents
Preface ...................................................................................................................................... v
I. Introduction ............................................................................................................................. 1
1. Why Spring Data - Document? ....................................................................................... 2
2. Requirements ................................................................................................................. 3
3. Additional Help Resources .............................................................................................. 4
3.1. Support ............................................................................................................... 4
Community Forum .............................................................................................. 4
Professional Support .......................................................................................... 4
3.2. Following Development ........................................................................................ 4
4. Repositories ................................................................................................................... 5
4.1. Introduction ......................................................................................................... 5
4.2. Core concepts ..................................................................................................... 5
4.3. Query methods ................................................................................................... 6
Defining repository interfaces .............................................................................. 7
Fine tuning repository definition ................................................................... 7
Defining query methods ...................................................................................... 8
Query lookup strategies .............................................................................. 8
Query creation ........................................................................................... 9
Special parameter handling ....................................................................... 10
Creating repository instances ............................................................................ 10
XML Configuration .................................................................................... 10
JavaConfig ............................................................................................... 11
Standalone usage .................................................................................... 12
4.4. Custom implementations .................................................................................... 12
Adding behaviour to single repositories .............................................................. 12
Adding custom behaviour to all repositories ....................................................... 13
4.5. Extensions ........................................................................................................ 15
Domain class web binding for Spring MVC ........................................................ 15
Web pagination ................................................................................................ 18
Repository populators ....................................................................................... 19
II. Reference Documentation ..................................................................................................... 21
5. MongoDB support ........................................................................................................ 22
5.1. Getting Started .................................................................................................. 22
5.2. Examples Repository ......................................................................................... 25
5.3. Connecting to MongoDB with Spring .................................................................. 25
Registering a Mongo instance using Java based metadata ................................. 25
Registering a Mongo instance using XML based metadata .................................. 26
The MongoDbFactory interface ......................................................................... 27
Registering a MongoDbFactory instance using Java based metadata ................... 28
Registering a MongoDbFactory instance using XML based metadata ................... 29
5.4. Introduction to MongoTemplate .......................................................................... 30
. Instantiating MongoTemplate ......................................................................... 31
WriteResultChecking Policy ....................................................................... 32
WriteConcern ........................................................................................... 32
WriteConcernResolver .............................................................................. 32
5.5. Saving, Updating, and Removing Documents ...................................................... 33
How the '_id' field is handled in the mapping layer .............................................. 35
please define productname in your docbook file!
1.2.0.RELEASE
Spring Data MongoDB -
Reference Documentation iii
Type mapping .................................................................................................. 36
Methods for saving and inserting documents ...................................................... 36
Which collection will my documents be saved into? .................................... 37
Inserting or saving individual objects ......................................................... 37
Inserting several objects in a batch ........................................................... 38
Updating documents in a collection ................................................................... 38
Methods for executing updates for documents ............................................ 38
Methods for the Update class ................................................................... 38
Upserting documents in a collection .................................................................. 39
Finding and Upserting documents in a collection ................................................ 39
Methods for removing documents ...................................................................... 40
5.6. Querying Documents ......................................................................................... 40
Querying documents in a collection ................................................................... 41
Methods for the Criteria class ................................................................... 41
Methods for the Query class ..................................................................... 42
Methods for querying for documents .................................................................. 43
GeoSpatial Queries .......................................................................................... 43
Geo near queries ..................................................................................... 45
5.7. Map-Reduce Operations .................................................................................... 45
Example Usage ................................................................................................ 46
5.8. Group Operations .............................................................................................. 47
Example Usage ................................................................................................ 48
5.9. Overriding default mapping with custom converters .............................................. 49
Saving using a registered Spring Converter ....................................................... 50
Reading using a Spring Converter ..................................................................... 50
Registering Spring Converters with the MongoConverter ..................................... 50
Converter disambiguation ................................................................................. 51
5.10. Index and Collection managment ...................................................................... 51
Methods for creating an Index ........................................................................... 52
Accessing index information .............................................................................. 52
Methods for working with a Collection ............................................................... 52
5.11. Executing Commands ...................................................................................... 53
Methods for executing commands ..................................................................... 53
5.12. Lifecycle Events ............................................................................................... 53
5.13. Exception Translation ....................................................................................... 54
5.14. Execution callbacks ......................................................................................... 55
5.15. GridFS support ................................................................................................ 55
6. MongoDB repositories .................................................................................................. 58
6.1. Introduction ....................................................................................................... 58
6.2. Usage ............................................................................................................... 58
6.3. Query methods .................................................................................................. 60
Geo-spatial repository queries ........................................................................... 61
MongoDB JSON based query methods and field restriction ................................. 62
Type-safe Query methods ................................................................................. 63
7. Mapping ....................................................................................................................... 65
7.1. Convention based Mapping ................................................................................ 65
How the '_id' field is handled in the mapping layer .............................................. 65
7.2. Mapping Configuration ....................................................................................... 66
7.3. Metadata based Mapping ................................................................................... 68
Mapping annotation overview ............................................................................ 69
please define productname in your docbook file!
1.2.0.RELEASE
Spring Data MongoDB -
Reference Documentation iv
Compound Indexes .......................................................................................... 71
Using DBRefs .................................................................................................. 71
Mapping Framework Events .............................................................................. 72
Overriding Mapping with explicit Converters ....................................................... 72
8. Cross Store support ..................................................................................................... 74
8.1. Cross Store Configuration .................................................................................. 74
8.2. Writing the Cross Store Application .................................................................... 76
9. Logging support ........................................................................................................... 79
9.1. MongoDB Log4j Configuration ............................................................................ 79
10. JMX support ............................................................................................................... 80
10.1. MongoDB JMX Configuration ........................................................................... 80
III. Appendix ............................................................................................................................. 82
A. Namespace reference .................................................................................................. 83
A.1. The <repositories /> element ..................................................................... 83
B. Repository query keywords ........................................................................................... 84
B.1. Supported query keywords ................................................................................ 84
please define productname in your docbook file!
1.2.0.RELEASE
Spring Data MongoDB -
Reference Documentation v
Preface
The Spring Data MongoDB project applies core Spring concepts to the development of solutions using
the MongoDB document style data store. We provide a "template" as a high-level abstraction for storing
and querying documents. You will notice similarities to the JDBC support in the Spring Framework.
剩余89页未读,继续阅读
hello_java_
- 粉丝: 20
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 2023年中国辣条食品行业创新及消费需求洞察报告.pptx
- 2023年半导体行业20强品牌.pptx
- 2023年全球电力行业评论.pptx
- 2023年全球网络安全现状-劳动力资源和网络运营的全球发展新态势.pptx
- 毕业设计-基于单片机的液体密度检测系统设计.doc
- 家用清扫机器人设计.doc
- 基于VB+数据库SQL的教师信息管理系统设计与实现 计算机专业设计范文模板参考资料.pdf
- 官塘驿林场林防火(资源监管)“空天地人”四位一体监测系统方案.doc
- 基于专利语义表征的技术预见方法及其应用.docx
- 浅谈电子商务的现状及发展趋势学习总结.doc
- 基于单片机的智能仓库温湿度控制系统 (2).pdf
- 基于SSM框架知识产权管理系统 (2).pdf
- 9年终工作总结新年计划PPT模板.pptx
- Hytera海能达CH04L01 说明书.pdf
- 数据中心运维操作标准及流程.pdf
- 报告模板 -成本分析与报告培训之三.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1