简体   繁体   English

自定义spring-data存储库后端

[英]Custom spring-data repository backend

I already have a working object storage service, developed in-house - let's call it a database. 我已经有了一个内部开发的工作对象存储服务 - 让我们把它称为数据库。 Now I would like to use spring-data for CRUD operations on it, so that in the future I can easily switch to some conventional database. 现在我想在它上面使用spring-data进行CRUD操作,以便将来我可以轻松切换到一些传统的数据库。 The question in: how can I implement yet another spring-data repository backend? 问题在于:我如何实现另一个spring-data存储库后端? Any guides, tutorials? 任何指南,教程?

The central piece to look at is the API in the Spring Data Commons module. 要查看的核心部分是Spring Data Commons模块中的API。 It effectively provides the foundation for all of the existing store implementations. 它有效地为所有现有的商店实施提供了基础。 The support consist of the following aspects: 支持包括以下几个方面:

  • Object-to-store mapping (meta-model and conversion implementation) 对象到存储映射(元模型和转换实现)
  • Repository implementation and DI container configuration support 存储库实现和DI容器配置支持

The best way to get started is by having a look at the MongoDB module for example and mimic the implementation. 入门的最佳方式是查看MongoDB模块 ,并模拟实现。 We're currently working on a developer guide whose work-in-progress version you can find in the Spring Data Commons wiki . 我们目前正在开发一个开发人员指南,您可以在Spring Data Commons维基中找到其正在进行中的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM