src/main/java/com/itfsw/mybatis/generator/plugins/OptimisticLockerPlugin.java
@Override
    public boolean modelSetterMethodGenerated(Method method, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable, ModelClassType modelClassType) {
        if (this.versionColumn != null && this.customizedNextVersion && introspectedColumn.getActualColumnName().equals(this.versionColumn.getActualColumnName())) {
            // nextVersion 方法
            Method nextVersion = JavaElementGeneratorTools.generateMethod(
                    METHOD_NEXT_VERSION,
                    JavaVisibility.PUBLIC,
                    null,
                    new Parameter(this.versionColumn.getFullyQualifiedJavaType(), "version")
            );
            commentGenerator.addSetterComment(nextVersion, introspectedTable, this.versionColumn);
            JavaElementGeneratorTools.generateMethodBody(
                    nextVersion,
                    "this." + this.versionColumn.getJavaProperty() + " = version;"
            );

            FormatTools.addMethodWithBestPosition(topLevelClass, nextVersion);
        }

        return super.modelSetterMethodGenerated(method, topLevelClass, introspectedColumn, introspectedTable, modelClassType);
    }
@Override
    public boolean modelSetterMethodGenerated(Method method, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable, ModelClassType modelClassType) {
        if (this.versionColumn != null && this.customizedNextVersion && introspectedColumn.getActualColumnName().equals(this.versionColumn.getActualColumnName())) {
            // nextVersion 方法
            Method nextVersion = JavaElementGeneratorTools.generateMethod(
                    METHOD_NEXT_VERSION,
                    JavaVisibility.PUBLIC,
                    null,
                    new Parameter(this.versionColumn.getFullyQualifiedJavaType(), "version")
            );
            commentGenerator.addSetterComment(nextVersion, introspectedTable, this.versionColumn);
            JavaElementGeneratorTools.generateMethodBody(
                    nextVersion,
                    "this." + this.versionColumn.getJavaProperty() + " = version;"
            );

            FormatTools.addMethodWithBestPosition(topLevelClass, nextVersion);
        }

        return super.modelSetterMethodGenerated(method, topLevelClass, introspectedColumn, introspectedTable, modelClassType);
    }
========================================= model 生成 ============================================