SpringMVCを使用してRESTAPIを作成しようとしています。コントローラごとにCRUDメソッドを作成する代わりに、一般的なRESTCRUDシナリオを処理する抽象クラスを作成しました。だから私はこれらの次のクラスを作成しました
public interface DomainObject<ID extends Serializable> {}
public class Apps implements DomainObject<String>{}
public interface AppsRepository extends PagingAndSortingRepository<Apps, String> {}
public abstract class AbstractController<T extends PagingAndSortingRepository<DomainObject<Serializable>, Serializable>> {}
上記のクラス/インターフェイス定義で、AbstractControllerを拡張するクラスを宣言するにはどうすればよいですか?
を使用してAppsControllerを宣言してみました
public class AppsController extends AbstractController<AppsRepository>{}
運がない。Eclipseは次のエラーを示しています
Bound mismatch: The type AppsRepository is not a valid substitute for the bounded parameter <T extends PagingAndSortingRepository<DomainObject<Serializable>,Serializable>> of the type AbstractController<T>
私は完全に立ち往生しています。私はしばらくの間、運がなくてもさまざまなアプローチを試してきました。どんな助けでも大歓迎です。