简体   繁体   English

不执行而覆盖spring仓库方法时会发生什么

[英]what happen when override spring repository method without implementing

Here is my spring repository interface 这是我的spring存储库界面

    interface TupleRepository extends JpaRepository<Tuple, Integer> {

    @Override
    @CacheEvict(cacheNames="tuples", allEntries=true)
    void delete(Tuple tuple);

}

As you see I overrided withoud giving any implementation. 如您所见,我没有提供任何实现。 the method is still working. 该方法仍然有效。

Which implem is being called. 哪个障碍被称为。

I tried the debugging and investigation but ended up in the aop class managing the call. 我尝试了调试和调查,但最终遇到了管理该调用的aop类。

does this method still call the jpaRepository implementation or what ? 此方法仍然调用jpaRepository实现还是什么?

The thing is, you did not actually provide an overriding implementation, so there is nothing really to debug on. 关键是,您实际上没有提供一个最重要的实现,因此没有什么可调试的。 At the end, the original implementation will be called. 最后,将调用原始实现。 The annotations you added on the method should be respected, though. 不过,应注意您在方法上添加的注释。

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

相关问题 当您使用super和此关键字调用替代方法时会发生什么? - What happen when you call an override method using super and this keyword? 覆盖hashcode()时会发生什么 - what happen when override hashcode() Spring Data REST:覆盖控制器上的存储库方法 - Spring Data REST: Override repository method on the controller Spring @Autowired 存储库在 @Override Netty 方法中不起作用 - Spring @Autowired repository not working in @Override Netty method 如果我们在spring MVC中互换@service和@repository注解会发生什么 - What will happen if we interchange @service and @repository annotation in the spring MVC 在Spring中实现JpaRepostiory时使用存储库批注 - Using repository annotation when implementing JpaRepostiory in Spring 实现接口方法时不允许@Override - @Override is not allowed when implementing interface method 弹簧石英间隔:如果方法需要更长时间再重复间隔会发生什么? - Spring quartz interval: what happen if method takes longer then repeat interval? 使用Spring存储库时,@ JsonView失败并显示``IllegalStateException无法覆盖序列化器&#39;&#39; - @JsonView fails with 'IllegalStateException Can not override serializer' when using Spring repository 在实现接口方法时我应该使用@Override标记吗? - Should I use @Override tag when implementing an interface method?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM