关于利用反射调用私有方法,私有方法中有对数据库的操作 为什么mapper没有注入进去?

关于利用反射调用私有方法,私有方法中有对数据库的操作 mapper没有注入进去
把private 改为 public 后 mapper 就能自动注入进去
代码类似下方

Class AImpl{
    @Autowried
    private AMapper  amapper;

    private f(){
        amapper.select();
    }

    public g(){
        amapper.select();
    }
}

Class Test{
    @Autowried
    private AImpl aImpl;

    public void test(){
        Method method = AImpl.class.getDeclaredMethod("f");
        method.setAccessible(true);
        Method.invoke(aImpl);
    }

        public void test(){
        Method method = AImpl.class.getDeclaredMethod("g");
        method.setAccessible(true);
        Method.invoke(aImpl);
    }

}

类似于 这篇文章https://www.jianshu.com/p/4b3f55e76637
中的代码

https://blog.csdn.net/yangsen159/article/details/87627300