<legend id='9Ch3O'><style id='9Ch3O'><dir id='9Ch3O'><q id='9Ch3O'></q></dir></style></legend>

<small id='9Ch3O'></small><noframes id='9Ch3O'>

<tfoot id='9Ch3O'></tfoot>

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

        @Transactional 注解属于哪里?

        时间:2023-07-26

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

          • <small id='nQLbo'></small><noframes id='nQLbo'>

                • <tfoot id='nQLbo'></tfoot>
                  <i id='nQLbo'><tr id='nQLbo'><dt id='nQLbo'><q id='nQLbo'><span id='nQLbo'><b id='nQLbo'><form id='nQLbo'><ins id='nQLbo'></ins><ul id='nQLbo'></ul><sub id='nQLbo'></sub></form><legend id='nQLbo'></legend><bdo id='nQLbo'><pre id='nQLbo'><center id='nQLbo'></center></pre></bdo></b><th id='nQLbo'></th></span></q></dt></tr></i><div id='nQLbo'><tfoot id='nQLbo'></tfoot><dl id='nQLbo'><fieldset id='nQLbo'></fieldset></dl></div>
                    <tbody id='nQLbo'></tbody>
                  <legend id='nQLbo'><style id='nQLbo'><dir id='nQLbo'><q id='nQLbo'></q></dir></style></legend>
                  本文介绍了@Transactional 注解属于哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  您应该将 @Transactional 放在 DAO 类和/或其方法中,还是最好注释使用 DAO 对象调用的服务类?或者注释两个层​​"有意义吗?

                  Should you place the @Transactional in the DAO classes and/or their methods or is it better to annotate the Service classes which are calling using the DAO objects? Or does it make sense to annotate both "layers"?

                  推荐答案

                  我认为事务属于服务层.它了解工作单元和用例.如果您将多个 DAO 注入到需要在单个事务中协同工作的服务中,那么这是正确的答案.

                  I think transactions belong on the service layer. It's the one that knows about units of work and use cases. It's the right answer if you have several DAOs injected into a service that need to work together in a single transaction.

                  这篇关于@Transactional 注解属于哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:@Component、@Repository 和 @Repository 有什么区别?Spri 下一篇:如何从常量 java 为注解提供值

                  相关文章

                  最新文章

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

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

                    1. <tfoot id='xEfpa'></tfoot>