news 2026/4/20 23:23:53

**Spring Data Document with MongoDB Support 1.0.0.M3** 是 Spring Data 早期针对 MongoDB 发布的里程碑版本(Milestone

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
**Spring Data Document with MongoDB Support 1.0.0.M3** 是 Spring Data 早期针对 MongoDB 发布的里程碑版本(Milestone

Spring Data Document with MongoDB Support 1.0.0.M3是 Spring Data 早期针对 MongoDB 发布的里程碑版本(Milestone 3),发布于2011 年。它是Spring Data MongoDB 项目的前身,从1.0.0.M4版本起,项目正式更名为Spring Data MongoDB

一、版本背景与定位

  • 项目原名:Spring Data Document (代号DATADOC)
  • 核心目标:为 Spring 开发者提供基于文档型数据库(当时主要是 MongoDB)的统一数据访问抽象。
  • 版本状态:早期开发里程碑(非稳定版),用于预览功能与收集反馈。
  • 关键更名:M3 是最后一个以 “Spring Data Document” 命名的版本;M4 起更名为 Spring Data MongoDB,包路径也从org.springframework.data.document.mongodb改为org.springframework.data.mongodb

二、核心新特性(相对于 M2)

  1. 重构 MongoTemplate 构造函数

    • 移除旧构造器:MongoTemplate(Mongo, String, String)
    • 引入新构造器:MongoTemplate(MongoDbFactory)MongoTemplate(Mongo, String, UserCredentials)
    • 目的:简化工厂模式、统一认证与数据源配置。
  2. 增强 Repository 编程模型

    • 完善基于接口的CRUD Repository自动实现。
    • 支持通过方法名解析查询(如findByLastName())。
  3. 对象映射(Mapping)优化

    • 强化POJO 与 MongoDB BSON 文档的转换能力。
    • 支持@Document,@Id,@Field等核心注解。
  4. 基础操作完善

    • 支持完整的增删改查(CRUD)、批量操作、原子findAndModify
    • 支持更新修饰符(Update Modifiers),实现文档部分更新。
    • 异常转译:将 MongoDB 原生异常转为 SpringDataAccessException层次结构。

三、技术依赖

  • MongoDB Java Driver:2.5.3 ~ 2.6.5
  • Spring Framework: 3.0.x 系列
  • Spring Data Commons: 1.2.x 系列

四、Maven 依赖坐标

<!-- 注意:需添加 Spring Milestone 仓库 --><repositories><repository><id>spring-milestone</id><url>http://repo.spring.io/milestone</url></repository></repositories><dependency><groupId>org.springframework.data</groupId><artifactId>spring-data-document-mongodb</artifactId><version>1.0.0.M3</version></dependency><dependency><groupId>org.mongodb</groupId><artifactId>mongo-java-driver</artifactId><version>2.5.3</version></dependency>

五、历史意义

此版本是Spring 生态进军 NoSQL的关键里程碑,奠定了后续 Spring Data MongoDB 简化开发的基石。虽然 API 已过时,但它确立的Template 模式Repository 抽象,至今仍是 Spring Data 家族的核心设计思想。


总结:1.0.0.M3 是 Spring Data MongoDB 的历史起点。现代开发应直接使用Spring Data MongoDB 4.x+稳定版。

Spring Data Document with MongoDB Support 1.0.0.M3 Released

I am pleased to announce that the Milestone 3 release of the Spring Data Document 1.0 project with MongoDB support is now available!
The primary goal of the Spring Data project is to make it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services.

The MongoDB module provides integration with the MongoDB document database.

Downloads | JavaDocs | Reference Documentation | Changelog

To learn more about the project, visit the Spring Data MongoDB Page.

The changes and new features in Spring Data Document 1.0.0.M3 includes much improved mapping and conversion support. The MappingMongoConverter is now the default converter used by the MongoTemplate and the SimpleMongoConverter has been deprecated and will be removed. The concept of a default collection name has also been removed and all operations of the MongoTemplate are based on the collection name used for the entity class that is the target of the operation. The collection name used for an entity class defaults to the clasname starting with a lower-case letter but it can be customized using the @Document annotation. See the changelog for more details.

Looking forward to your feedback on the forum or in the issue tracker.
comments powered by Disqus

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/4/20 23:22:44

Dify 2026多模态集成避坑手册:92%开发者忽略的模态对齐偏差校准、token截断容错与异构Embedding归一化技巧

第一章&#xff1a;Dify 2026多模态集成的核心演进与架构跃迁Dify 2026标志着从单模态推理平台向统一多模态智能中枢的关键性跨越。其核心演进体现在模型协同调度层、跨模态对齐引擎与动态上下文感知执行器三大支柱的深度融合&#xff0c;彻底重构了传统LLM应用框架的边界。多模…

作者头像 李华
网站建设 2026/4/20 23:21:19

人形机器人跑完半马:今年具身智能的第一次大考

50分26秒&#xff0c;21公里&#xff0c;冠军诞生了。01 4月19日&#xff0c;北京亦庄。 全球首个人形机器人半程马拉松品牌赛事鸣枪开跑。 21公里的赛道&#xff0c;300余台机器人&#xff0c;超百支队伍同场竞技。 这是今年具身智能行业最直观的一次能力检验。02 先说成绩。 …

作者头像 李华
网站建设 2026/4/20 23:19:19

Open UI5 源代码解析之1106:MenuTextFieldItem.js

源代码仓库: https://github.com/SAP/openui5 源代码位置:src\sap.ui.commons\src\sap\ui\commons\MenuTextFieldItem.js MenuTextFieldItem.js 文件深度分析 这不是普通菜单项,而是把输入能力塞进菜单体系的特殊桥接点 MenuTextFieldItem.js 这个文件和前面那些 commo…

作者头像 李华
网站建设 2026/4/20 23:16:39

YaeAchievement:如何3分钟快速导出原神全成就数据

YaeAchievement&#xff1a;如何3分钟快速导出原神全成就数据 【免费下载链接】YaeAchievement 更快、更准的原神数据导出工具 项目地址: https://gitcode.com/gh_mirrors/ya/YaeAchievement 还在为整理《原神》数百项成就而烦恼吗&#xff1f;YaeAchievement作为一款开…

作者头像 李华
网站建设 2026/4/20 23:13:19

小程序和会员系统的区别?

小程序和会员系统的区别&#xff1f;小程序和会员系统的核心区别&#xff0c;不在于功能多少&#xff0c;而在于&#xff1a;一个是业务载体&#xff0c;一个是用户管理机制。更直接地说&#xff0c;小程序解决“用户在哪里发生行为”&#xff0c;而会员系统解决“如何管理这些…

作者头像 李华
网站建设 2026/4/20 23:11:47

Pytorch中MaxPool2d参数详解与实战调优:从理论到代码的完整指南

1. MaxPool2d的核心参数解析 在PyTorch中&#xff0c;torch.nn.MaxPool2d是实现最大池化操作的核心类。理解它的参数就像掌握烹饪中的调料配比&#xff0c;不同的组合会产生截然不同的效果。我们先来看看这个"调料盒"里都有哪些关键参数&#xff1a; kernel_size&…

作者头像 李华