{"record":{"id":"fe79e4f215693826","repo":"baomidou/mybatis-plus","slug":"unknown-execution-method-for-s","errorCode":null,"errorMessage":"Unknown execution method for: %s","messagePattern":"Unknown execution method for: (.+?)","errorType":"exception","errorClass":"BindingException","httpStatus":null,"severity":"error","filePath":"mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/override/MybatisMapperMethod.java","lineNumber":121,"sourceCode":"                    result = executeForCursor(sqlSession, args);\n                } else {\n                    if (IPage.class.isAssignableFrom(method.getReturnType())) {\n                        result = executeForIPage(sqlSession, args);\n                    } else {\n                        Object param = this.convertArgsToSqlCommandParam(args);\n                        result = sqlSession.selectOne(command.getName(), param);\n                        if (method.returnsOptional()\n                            && (result == null || !method.getReturnType().equals(result.getClass()))) {\n                            result = Optional.ofNullable(result);\n                        }\n                    }\n                }\n                break;\n            case FLUSH:\n                result = sqlSession.flushStatements();\n                break;\n            default:\n                throw new BindingException(\"Unknown execution method for: \" + command.getName());\n        }\n        if (result == null && method.getReturnType().isPrimitive() && !method.returnsVoid()) {\n            throw new BindingException(\"Mapper method '\" + command.getName()\n                + \" attempted to return null from a method with a primitive return type (\" + method.getReturnType() + \").\");\n        }\n        return result;\n    }\n\n    @SuppressWarnings(\"all\")\n    private <E> Object executeForIPage(SqlSession sqlSession, Object[] args) {\n        IPage<E> result = null;\n        for (Object arg : args) {\n            if (arg instanceof IPage) {\n                result = (IPage<E>) arg;\n                break;\n            }\n        }\n        Assert.notNull(result, \"can't found IPage for args!\");","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/baomidou/mybatis-plus/blob/bf67d907478c724120bf76292da54abf9e73c2b3/mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/override/MybatisMapperMethod.java#L103-L139","documentation":"MybatisMapperMethod.execute switches on the statement's SqlCommandType (INSERT/UPDATE/DELETE/SELECT/FLUSH); this default branch means the mapped statement has a command type outside the known set. In practice this appears with exotic or custom SqlCommandType values, or a corrupted/incompatible statement registration.","triggerScenarios":"A mapped statement registered with a custom/unknown SqlCommandType enum constant (e.g. from a fork or future version), or statement metadata manipulated by a plugin so command.getType() is null/unrecognized; calling a mapper method bound to such a statement.","commonSituations":"Mixing incompatible mybatis/mybatis-plus versions so enum constants differ; custom starter registering statements with hand-built SqlCommandType; reflective hacks on MappedStatement.","solutions":["Align mybatis and mybatis-plus versions (dependency tree check) so SqlCommandType constants match","Find the statement named in the message ('Unknown execution method for: <id>') and inspect what registered it with an unexpected type","Remove plugins/interceptors that mutate MappedStatement command types"],"exampleFix":"# before\nmybatis-plus: 3.5.x + mybatis: 3.4.x (mismatched)\n# after\nkeep the mybatis version transitively provided by the matching mybatis-plus artifact","handlingStrategy":"validation","validationCode":"// Startup smoke test: call every mapper method once against a test container\napplicationContext.getBeansOfType(MapperFactoryBean.class) ... // or simpler: run mapper integration tests so unknown command types surface before prod","typeGuard":null,"tryCatchPattern":"catch BindingException during mapper smoke-tests at deploy time; treat as a deployment-blocking version mismatch, not a runtime-recoverable error.","preventionTips":["Never mix standalone mybatis versions with the version mybatis-plus pulls transitively","Run mvn dependency:tree and verify a single mybatis artifact version","Smoke-test mapper invocations in CI against a real database container"],"tags":["mybatis","binding","version-conflict","internals"],"backgroundTag":null,"analyzedSha":"bf67d907478c724120bf76292da54abf9e73c2b3","analyzedAt":"2026-08-14T15:17:09.543Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}