Feature request: more warnings at startup

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Feature request: more warnings at startup

mybatis-user mailing list
Hello group,

long-time user here. I think I started using i-now-my-Batis back in 2008. Long way. Big thank you for all the great work so far!

When you have projects that old you end up collection much technical debt and start to refactor. I like to refactor stuff. It is really my favorite task as a programmer. Unfortunately refactoring Mapper-XML files is not much fun. Let me explain. We have Mapper-Interface files and Mapper-XML files. During refactoring you often want to get rid of method signatures or remove them completely. Of course your program should not crash after refactoring. The binding from Mapper-interface method signatures to Mapper-XML files happens at runtime. Rename a method signature and forget to update the id attribute in the XML file. Crash happens only if you call the method on the proxy from session.getMapper(). Have some method signatures without a mapped statement? No warning. Have some mapped statements without a method signature? No warning. I believe a one-time check during initialisation would help the situation tremendously.

Maybe there is already a flag that checks this somewhere and I haven't found it.

tl;dr: Check invalid bound statements at startup-time and not only during runtime. Makes refactoring so much easier.

kind regards

You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.