Support default methods on mapper interfaces
See original GitHub issueI’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:
- Created 7 years ago
- Reactions:8
- Comments:10 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Never mind. It should be fixed in the latest 3.4.2-SNAPSHOT. Please let me know if it works as you expected.
I think supporting default method is good idea!!