Interface inheritance is not yet supported.  There's a Jira ticket with a patch submitted, here:


On Thu, Dec 10, 2009 at 11:23 AM, Soks86 <> wrote:


I've been switching my project over to iBATIS from a pretty complete
Hibernate project. I've run into an issue with how the iBATIS configuration
seems to look up mapped methods. I'm currently using Beta 5 since my Maven
isn't seeing for some reason. I have an interface
dao as such:

public interface Dao<T> {
   void delete(T arg);
   void save(T arg);
   void update(T arg);
   T load(T arg);

then I have another interface which extends this

public interface SomeTypeDao extends Dao<SomeType> {
  SomeType loadBySomething(String arg);

and finally my implementation:

public class IbatisSomeTypeDao implements SomeTypeDao {
  void delete(SomeType arg) {
     SqlSession session = sessionFactory.openSession();
     try {
        SomeTypeDao dao = session.getMapper(SomeTypeDao.class);
     } finally {
     //... other code omitted but present in actual code

My mapping file is for the namespace of SomeTypeDao and that is the only
mapped interface or class from the three I posted above.

Now when I call IbatisSomeTypeDao.delete(arg) instead of finding my mapped
interface (SomeTypeDao.delete()) iBATIS seems to look for delete() in my
Dao<T> class instead and thus it looks for a mapping for Dao<T> (which
doesn't exist) and then I get this exception:

java.lang.IllegalArgumentException: Mapped Statements collection does not
contain value for com.icarus.common.dao.Dao.delete
       at org.apache.ibatis.binding.MapperMethod.<init>(
       at org.apache.ibatis.binding.MapperProxy.invoke(
       at $Proxy1.delete(Unknown Source)

Am I missing something here? It would seem to me that this is a limitation
of iBATIS' configuration class. Shouldn't it first look for a mapping for
SomeTypeDao and find my mapping? I do know for a fact that if I call
SomeTypeDao.loadBySomething (method that isn't in Dao<T> generic type) then
the Configuration seems to find the appropriate mapping and doesn't
complain. However any method that was inherited by the interface is mapped
to the parent interface it seems.

Ideas? Help?

View this message in context:
Sent from the iBATIS - User - Java mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail: