1. <legend id='cWhb0'><style id='cWhb0'><dir id='cWhb0'><q id='cWhb0'></q></dir></style></legend>

      <bdo id='cWhb0'></bdo><ul id='cWhb0'></ul>

    <i id='cWhb0'><tr id='cWhb0'><dt id='cWhb0'><q id='cWhb0'><span id='cWhb0'><b id='cWhb0'><form id='cWhb0'><ins id='cWhb0'></ins><ul id='cWhb0'></ul><sub id='cWhb0'></sub></form><legend id='cWhb0'></legend><bdo id='cWhb0'><pre id='cWhb0'><center id='cWhb0'></center></pre></bdo></b><th id='cWhb0'></th></span></q></dt></tr></i><div id='cWhb0'><tfoot id='cWhb0'></tfoot><dl id='cWhb0'><fieldset id='cWhb0'></fieldset></dl></div>
    <tfoot id='cWhb0'></tfoot>
  2. <small id='cWhb0'></small><noframes id='cWhb0'>

    1. 具有 DynamoDB 和 MySQL 双数据源的 Spring Data/JPA 存储库

      时间:2023-06-26

      • <bdo id='n2mL0'></bdo><ul id='n2mL0'></ul>

          <tfoot id='n2mL0'></tfoot>

          <small id='n2mL0'></small><noframes id='n2mL0'>

            <legend id='n2mL0'><style id='n2mL0'><dir id='n2mL0'><q id='n2mL0'></q></dir></style></legend>
              <tbody id='n2mL0'></tbody>

                <i id='n2mL0'><tr id='n2mL0'><dt id='n2mL0'><q id='n2mL0'><span id='n2mL0'><b id='n2mL0'><form id='n2mL0'><ins id='n2mL0'></ins><ul id='n2mL0'></ul><sub id='n2mL0'></sub></form><legend id='n2mL0'></legend><bdo id='n2mL0'><pre id='n2mL0'><center id='n2mL0'></center></pre></bdo></b><th id='n2mL0'></th></span></q></dt></tr></i><div id='n2mL0'><tfoot id='n2mL0'></tfoot><dl id='n2mL0'><fieldset id='n2mL0'></fieldset></dl></div>
              1. 本文介绍了具有 DynamoDB 和 MySQL 双数据源的 Spring Data/JPA 存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我熟悉如何让 Spring 通过多个持久性单元和多个 entityManagerFactoryBean 实现动态处理多个数据源,但我正在努力解决的是如何使用 MySQL 方言 DynamoDB 方言在同一个 spring 配置中,通过 spring-config xml 文件.

                I'm familiar with how to make Spring handle multiple datasources dynamically via multiple persistence-units and multiple entityManagerFactoryBean implementations but what I'm struggling with is how to have a MySQL dialect and a DynamoDB dialect from within the same spring configuration, via spring-config xml files.

                工作模式如下:

                [来自某个端点的数据 POJO] ->将 POJO 持久化到 DynamoDB 中,检索该对象的 UUID(业务键作为 POJO 上的字段)->将 UUID 作为复合键(没有参照完整性,它只是另一列)保存到 MySQL 数据库[与其他相关映射实体].

                [data POJO in, from some endpoint] -> Persist POJO into DynamoDB, retrieving the UUID of that object (business key as field on POJO) -> Persist UUID as a compound key (no referential integrity, it's just another column) into MySQL Database [with other related mapped entities].

                我正在为如何将 DynamoDB 实例添加到 Spring 配置文件中来实现这一点而苦苦挣扎.

                I'm struggling with quite how on earth to go about adding the DynamoDB instance into the Spring configuration files to achieve this.

                不管怎样,相关的存储库将位于单独的包中.

                For what it's worth, the related repositories are going to be in separate packages.

                任何 10 人的首发将不胜感激!我已经进行了一些搜索,但所有 DynamoDB 映射器框架似乎都处于更高的水平 - 我在这里错过了什么吗?我一直在查看 Spring-Data DynamoDB 但仍然无法建立联系配置文件和 Dynamo.

                Any starters for 10 would be gratefully received! I've done some searching but all DynamoDB mapper frameworks seem to be at a much higher level - have I missed something here? I've been looking at Spring-Data DynamoDB but still can't make the link between the configuration file and Dynamo.

                提前致谢,

                一个.

                ========= 更新思维=========

                ========= UPDATE IN THINKING =========

                我认为我做错了.通过更多地挖掘样本,进行本地集成测试 [纯 dynamodb],我认为不可能将 DynamoDB 用作 EntityManager Factory 实现的一部分:为此,我认为我将不得不创造"我自己的存储库实现调用 Dynamo 的映射器和 AWS 连接帮助器类等,而不是使用任何 JPA spring 提供的代码.

                I think I've gone about this the wrong way. From digging around the samples a lot more, doing a local integration test [pure dynamodb], I don't think it's possible to use DynamoDB as part of an EntityManager Factory implementation: to that end, I think I'm going to have to "create" my own repository implementations that call out to the mapper and AWS connection helper classes etc. for Dynamo, rather than using any of the JPA spring-provided code.

                除非有人可以推荐/建议否则?

                Unless anyone can recommend/suggest otherwise?

                推荐答案

                问题结束 - 经过大量调查,唯一真正的方法是引入自己对存储库和基于 DAO 的实现的解释.

                Question closed - after much investiation the only real way to do it is to introduce ones own interpretation of a repository and DAO-based implementation.

                然而,有一个有趣的项目,Spring Data Dynamodb.看起来很有趣,但还没有为企业生产版本做好准备.

                There is one interesting project, however, Spring Data Dynamodb. Looks interesting but not quite ready for Enterprise Production release.

                这篇关于具有 DynamoDB 和 MySQL 双数据源的 Spring Data/JPA 存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:DynamoDBMappingException:没有 HASH 键的映射 下一篇:使用 IN 子句查询 DynamoDB

                相关文章

                <i id='Z7d01'><tr id='Z7d01'><dt id='Z7d01'><q id='Z7d01'><span id='Z7d01'><b id='Z7d01'><form id='Z7d01'><ins id='Z7d01'></ins><ul id='Z7d01'></ul><sub id='Z7d01'></sub></form><legend id='Z7d01'></legend><bdo id='Z7d01'><pre id='Z7d01'><center id='Z7d01'></center></pre></bdo></b><th id='Z7d01'></th></span></q></dt></tr></i><div id='Z7d01'><tfoot id='Z7d01'></tfoot><dl id='Z7d01'><fieldset id='Z7d01'></fieldset></dl></div>
                  <bdo id='Z7d01'></bdo><ul id='Z7d01'></ul>
              2. <legend id='Z7d01'><style id='Z7d01'><dir id='Z7d01'><q id='Z7d01'></q></dir></style></legend>

                <small id='Z7d01'></small><noframes id='Z7d01'>

                    <tfoot id='Z7d01'></tfoot>