quickstart教程里的一些问题

This issue has been tracked since 2021-08-10.
  1. 快速入门教程的“配置”里,SpringBoot启动类是
@SpringBootApplication
@MapperScan("com.baomidou.mybatisplus.samples.quickstart.mapper")
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(QuickStartApplication.class, args);
    }

}

上面的public class Application是不是应该为public class QuickStartApplicationmybatis-plus-samples里是QuickStartApplication

  1. 快速入门教程的“开始使用”里,测试类上的注解为@SpringBootTest,我在这样注解后运行会报错NullPointerException,应该是private UserMapper userMapper没有注册上。我看mybatis-plus-samples里的注解是@RunWith(SpringRunner.class)@SpringBootTest,这样注解后跑通了。建议在快速入门教程里也使用@RunWith(SpringRunner.class)@SpringBootTest这样能直接跑通的写法,不至于让初学者在最开始卡住。
More Details About Repo
Owner Name baomidou
Repo Name mybatis-plus-doc
Full Name baomidou/mybatis-plus-doc
Language JavaScript
Created Date 2016-08-29
Updated Date 2022-12-02
Star Count 612
Watcher Count 56
Fork Count 2720
Issue Count 1

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date