Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring数据自定义存储库覆盖优先级未按文档所述工作_Spring_Repository - Fatal编程技术网

Spring数据自定义存储库覆盖优先级未按文档所述工作

Spring数据自定义存储库覆盖优先级未按文档所述工作,spring,repository,Spring,Repository,我提供了一份报告 此代码段总结了问题: 接口水果库:CoroutineCrudRepository,水果库定制 接口位置定制{ suspend-fun-findById(id:Long):水果? } 类FruitRepositoryCustomizationImpl():FruitRepositoryCustomization{ 重写suspend-fun-findById(id:Long):Fruit?=错误(“这永远不会发生,尽管它应该发生”) } 接口TreeRepository:Coro

我提供了一份报告

此代码段总结了问题:

接口水果库:CoroutineCrudRepository,水果库定制
接口位置定制{
suspend-fun-findById(id:Long):水果?
}
类FruitRepositoryCustomizationImpl():FruitRepositoryCustomization{
重写suspend-fun-findById(id:Long):Fruit?=错误(“这永远不会发生,尽管它应该发生”)
}
接口TreeRepository:CoroutineCrudRepository,TreeRepositoryCustomization
接口树位置自定义{
suspend-fun-findById(id:id):树?
}
类TreeRepositoryCustomizationImpl:TreeRepositoryCustomization{
override suspend fun findById(id:Long):树?=错误(“这将发生,如预期的那样”)
}
缔约国指出:

自定义实现的优先级高于基本实现 实现和存储库方面。此排序允许您重写 基本存储库和方面方法,并解决二者之间的歧义 片段提供相同的方法签名

显示仅当覆盖的参数类型通过泛型可供自定义实现使用时,才会发生覆盖。没有泛型的匹配签名不会导致重写


我不确定这是否是预期行为,更确切地说,这是一个bug/一个可以改进的问题。

请将代码添加到您的问题中,不要链接到GitHub回购,让人们搜索。