Annotation 中 @Repository 和 @Service 和 @Controller可以互换吗?

xiaoxiao2021-02-28  47

是可以互换的。图一是其中一个测试,把DaoImpl中的@Repository换为@Service,可以正确运行。

图二是 @Repository 和 @Service 和 @Controller三者完全互换例子的,一张截图。

END

转载请注明原文地址: https://www.6miu.com/read-2628680.html

最新回复(0)