src/main/java/com/itfsw/mybatis/generator/plugins/ExampleTargetPlugin.java
@Override
    public void initialized(IntrospectedTable introspectedTable) {
        super.initialized(introspectedTable);
        String exampleType = introspectedTable.getExampleType();
        // 修改包名
        Context context = getContext();
        JavaModelGeneratorConfiguration configuration = context.getJavaModelGeneratorConfiguration();
        String targetPackage = configuration.getTargetPackage();
        String newExampleType = exampleType.replace(targetPackage, this.targetPackage);

        introspectedTable.setExampleType(newExampleType);

        logger.debug("itfsw(Example 目标包修改插件):修改"+introspectedTable.getExampleType()+"的包到"+this.targetPackage);
    }
@Override
    public void initialized(IntrospectedTable introspectedTable) {
        super.initialized(introspectedTable);
        String exampleType = introspectedTable.getExampleType();
        // 修改包名
        Context context = getContext();
        JavaModelGeneratorConfiguration configuration = context.getJavaModelGeneratorConfiguration();
        String targetPackage = configuration.getTargetPackage();
        String newExampleType = exampleType.replace(targetPackage, this.targetPackage);

        introspectedTable.setExampleType(newExampleType);

        logger.debug("itfsw(Example 目标包修改插件):修改"+introspectedTable.getExampleType()+"的包到"+this.targetPackage);
    }
@ Override public void initialized ( IntrospectedTable introspectedTable ) { super . initialized ( introspectedTable ) ; String exampleType = introspectedTable . getExampleType ( ) ; // 修改包名 Context context = getContext ( ) ; JavaModelGeneratorConfiguration configuration = context . getJavaModelGeneratorConfiguration ( ) ; String targetPackage = configuration . getTargetPackage ( ) ; String newExampleType = exampleType . replace ( targetPackage , this . targetPackage ) ; introspectedTable . setExampleType ( newExampleType ) ; logger . debug ( "itfsw(Example 目标包修改插件):修改"+introspectedTable . getExampleType()+ " 的包到"+this.targ e t P ackage); }
初始化阶段
具体执行顺序 http://www.mybatis.org/generator/reference/pluggingIn.html

@param introspectedTable
初始化阶段 具体执行顺序 http : // www . mybatis . org / generator / reference / pluggingIn . html