question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support default methods on mapper interfaces

See original GitHub issue

I’d like support for default methods on mapper interfaces. Currently if a method is not implemented (even if it is a default method) an exception is thrown:

      if (ms == null) {
        if(method.getAnnotation(Flush.class) != null){
          name = null;
          type = SqlCommandType.FLUSH;
        } else {
          throw new BindingException("Invalid bound statement (not found): " + statementName);
        }
      }

I believe it would be relatively easy to add a type SqlCommandType.ABSTRACT and call the underlying default function.

It is a useful feature because it allows you to put helper methods on mappers.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:8
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
harawatacommented, Jul 10, 2016

Never mind. It should be fixed in the latest 3.4.2-SNAPSHOT. Please let me know if it works as you expected.

4reactions
kazuki43zoocommented, Jul 6, 2016

I think supporting default method is good idea!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Default Methods - The Java™ Tutorials - Oracle Help Center
Default methods enable you to add new functionality to the interfaces of your libraries and ensure binary compatibility with code written for older...
Read more >
MyBatis doesn't implement default methods of parent interface ...
In mybatis default methods of mappers are invoked directly and this is a feature. They should not be mapped in xml mapping and...
Read more >
Default Methods In Java 8 - GeeksforGeeks
Interfaces can have default methods with implementation in Java 8 on later. Interfaces can have static methods as well, similar to static ...
Read more >
Java 8: Default Interface Methods | Veracode
Default methods enable you to add new functionality to the interfaces of your libraries and ensure binary compatibility with code written for ...
Read more >
Default Methods in Java 8: What are they? - Xperti
Before default methods in Java 8, interfaces could only have ... by providing support for pre-existing implementations of List or Map during ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found