0

私は定義を持っています:

public interface  FruitsRepository extends MongoRepository<Fruits, String>,  FruitsRepositoryCustom {
...
}

public interface  FruitsRepositoryCustom {
...
}

public class FruitsRepositoryImpl implements  FruitsRepositoryCustom {
...
}

の名前をに変更しようとすると FruitsRepositoryImplFruitsRepositoryXImpl春に認識されず、例外が発生します。これは何が原因で、カスタム インターフェイスで実装するクラスの名前を変更するにはどうすればよいですか?

4

1 に答える 1

1

デフォルトでは、カスタム リポジトリの実装名の接尾辞はImplです。

変更するには、要素の属性をXImpl変更する必要があります。次のようなもの:repository-impl-postfixrepositories

<repositories repository-impl-postfix="XImpl" base-package=...>

またはJavaを使用して:

@EnableMongoRepositories(repositoryImplementationPostfix="Ximpl" basePackages=...)

ただし、接尾辞名の変更はすべてのカスタム リポジトリに適用されることに注意してください。

詳細については、リファレンス ドキュメントの名前空間リファレンスを参照してください。

于 2015-08-18T08:37:32.723 に答える