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

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

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

      • <bdo id='o9biT'></bdo><ul id='o9biT'></ul>
    2. 如何禁用 Spring Data REST 存储库的默认公开?

      时间:2024-08-24
        • <bdo id='dnzVW'></bdo><ul id='dnzVW'></ul>

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

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

            • <i id='dnzVW'><tr id='dnzVW'><dt id='dnzVW'><q id='dnzVW'><span id='dnzVW'><b id='dnzVW'><form id='dnzVW'><ins id='dnzVW'></ins><ul id='dnzVW'></ul><sub id='dnzVW'></sub></form><legend id='dnzVW'></legend><bdo id='dnzVW'><pre id='dnzVW'><center id='dnzVW'></center></pre></bdo></b><th id='dnzVW'></th></span></q></dt></tr></i><div id='dnzVW'><tfoot id='dnzVW'></tfoot><dl id='dnzVW'><fieldset id='dnzVW'></fieldset></dl></div>

                  <tbody id='dnzVW'></tbody>
                本文介绍了如何禁用 Spring Data REST 存储库的默认公开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个使用 spring-data-rest 的项目,并且有一个只使用 Spring Data 的依赖项目.两个项目都有spring数据仓库,都使用@EnableJpaRepositories来实现它们的仓库接口,但是我只想导出父项目中的仓库.

                I have a project that uses spring-data-rest, and has a dependency project that only uses Spring Data. Both projects have spring data repositories and use @EnableJpaRepositories to implement their repository interfaces, but I only want to export the repositories in the parent project.

                这是我的问题:是否有某种方法可以将 Spring Data REST 配置为仅公开父项目中资源的其余端点,而不必使用 @RepositoryRestResource(exported = false) 显式注释依赖项项目中的每个存储库?

                Here's my question: is there some way to configure Spring Data REST to only expose rest endpoints for resources in the parent project, without having to explicitly annotate every repository in the dependency project with @RepositoryRestResource(exported = false)?

                如果我只能通过禁用它的 @RepositoryRestResource 来做到这一点,更糟糕的是,没有其他具有不同用例的项目能够为这些存储库启用 REST 端点,我的依赖项目将必须包含 Spring Data REST 仅用于……

                If I can only do this with @RepositoryRestResource of disabling it, and worse yet, no other project with a different use case will be able to enable REST endpoints for those repositories, my dependency project will have to include Spring Data REST solely for the…

                推荐答案

                目前没有全局开关可以满足您的需求.我已经为您提交了这张票,以便包含在下一个主要版本中.

                Currently there's no global switch for what you're looking for. I've filed this ticket for you for inclusion in the next major release.

                不确定它是否适合您,但包私有存储库接口当前不公开,除非明确注释.如果您可以将所有这些库存储库包保护起来,这可能比显式注释更有利.

                Not sure if it is an option for you but package private repository interfaces are not currently exposed unless explicitly annotated. If you can make all those library repositories package protected that might be favorable over the explicit annotation.

                这篇关于如何禁用 Spring Data REST 存储库的默认公开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:spring-data-mongodb 在一个 Mongo 实例中连接多个数据库 下一篇:如何保存引用 Spring JPA 中现有实体的新实体?

                相关文章

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

                  • <bdo id='je8yG'></bdo><ul id='je8yG'></ul>
                  <legend id='je8yG'><style id='je8yG'><dir id='je8yG'><q id='je8yG'></q></dir></style></legend>
                    <tfoot id='je8yG'></tfoot>

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