문제

I'm trying to define a base mapper interface for MyBatis. I've tried this:

public interface IMapper<T> {
    <T> T select(int id);
}

public interface FooMapper extends IMapper<Foo>{
    @Override
    @Select("SELECT * FROM foos WHERE id = {#id}")
    Foo select(int id);
}

But I'm getting Unchecked Overriding warnings from IntelliJ. Should I disable them, or am I really doing something wrong?

도움이 되었습니까?

해결책

Remove the extra <T> on the select method so it is:

interface IMapper<T> {
    T select(int id);
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top