Skip to content

Commit

Permalink
feat Compatible with mybatis-plus 3.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
SweetInk committed Jul 5, 2024
1 parent ed3be37 commit 272eae7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
* @since 2019/5/9 19:42
*/
public class MybatisMapperAnnotationBuilderCBP extends JavassistClassBytecodeProcessor {

class LoadXmlResourceHook extends ExprEditor {
LoadXmlResourceHook() {
}

public void edit(NewExpr e) throws CannotCompileException {
if ("org.apache.ibatis.builder.xml.XMLMapperBuilder".equals(e.getClassName())) {
String className = e.getClassName();
if ("org.apache.ibatis.builder.xml.XMLMapperBuilder".equals(className) ||
"com.baomidou.mybatisplus.core.MybatisXMLMapperBuilder".equals(className)) {
e.replace("{ $_ = $proceed($$); if ($2 instanceof JrConfiguration) { SqlMapReloader reloader = ((JrConfiguration) $2).getReloader(); if (reloader != null) { reloader.addMapping(Resources.getResourceURL($3), $3); } }}");
}
}
Expand Down

0 comments on commit 272eae7

Please sign in to comment.