Class UnmergeableXmlMappersPlugin

java.lang.Object
org.mybatis.generator.api.PluginAdapter
org.mybatis.generator.plugins.UnmergeableXmlMappersPlugin
All Implemented Interfaces:
Plugin

public class UnmergeableXmlMappersPlugin extends PluginAdapter
This plugin marks generated XML mapper files as unmergeable. This will cause the generator to either overwrite the files, or save the files under a new name depending on how the overwrite setting is configured.

This can be useful when comments are disabled so the normal XML merge won't work.

Author:
Jeff Butler
  • Constructor Details

    • UnmergeableXmlMappersPlugin

      public UnmergeableXmlMappersPlugin()
  • Method Details

    • validate

      public boolean validate(List<String> warnings)
      Description copied from interface: Plugin
      This method is called after all the setXXX methods are called, but before any other method is called. This allows the plugin to determine whether it can run or not. For example, if the plugin requires certain properties to be set, and the properties are not set, then the plugin is invalid and will not run.
      Parameters:
      warnings - add strings to this list to specify warnings. For example, if the plugin is invalid, you should specify why. Warnings are reported to users after the completion of the run.
      Returns:
      true if the plugin is in a valid state. Invalid plugins will not be called
    • sqlMapGenerated

      public boolean sqlMapGenerated(GeneratedXmlFile sqlMap, IntrospectedTable introspectedTable)
      Description copied from interface: Plugin
      This method is called when the SqlMap file has been generated.
      Parameters:
      sqlMap - the generated file (containing the file name, package name, and project name)
      introspectedTable - The class containing information about the table as introspected from the database
      Returns:
      true if the sqlMap should be generated, false if the generated sqlMap should be ignored. In the case of multiple plugins, the first plugin returning false will disable the calling of further plugins.