Question

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?

Was it helpful?

Solution

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

interface IMapper<T> {
    T select(int id);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top