Class DisableInsertPlugin

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

public class DisableInsertPlugin extends PluginAdapter
Disables all insert methods in the MyBatis3DynamicSQL and MyBatis3Kotlin runtimes.
Author:
Jeff Butler
  • Constructor Details

    • DisableInsertPlugin

      public DisableInsertPlugin()
  • 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
    • clientBasicInsertMethodGenerated

      public boolean clientBasicInsertMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable)
      Description copied from interface: Plugin
      This method is called when the insert method has been generated for the mapper interface. This method is only called in the MyBatis3DynamicSql runtime. This method is only called if the table has generated keys.
      Parameters:
      method - the generated insert method
      interfaze - the partially generated mapper interfaces
      introspectedTable - The class containing information about the table as introspected from the database
      Returns:
      true if the method should be generated, false if the generated method should be ignored. In the case of multiple plugins, the first plugin returning false will disable the calling of further plugins.
    • clientBasicInsertMethodGenerated

      public boolean clientBasicInsertMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile, IntrospectedTable introspectedTable)
      Description copied from interface: Plugin
      This method is called when the insert function has been generated for the mapper interface. This method is only called in the MyBatis3Kotlin runtime. This method is only called if the table has generated keys.
      Parameters:
      kotlinFunction - the generated insert function
      kotlinFile - the partially generated file
      introspectedTable - The class containing information about the table as introspected from the database
      Returns:
      true if the function should be generated, false if the generated function should be ignored. In the case of multiple plugins, the first plugin returning false will disable the calling of further plugins.
    • clientBasicInsertMultipleMethodGenerated

      public boolean clientBasicInsertMultipleMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable)
      Description copied from interface: Plugin
      This method is called when the insert multiple method has been generated for the mapper interface. This method is only called in the MyBatis3DynamicSql runtime. This method is only called if the table has generated keys.
      Parameters:
      method - the generated insert method
      interfaze - the partially generated mapper interfaces
      introspectedTable - The class containing information about the table as introspected from the database
      Returns:
      true if the method should be generated, false if the generated method should be ignored. In the case of multiple plugins, the first plugin returning false will disable the calling of further plugins.
    • clientBasicInsertMultipleMethodGenerated

      public boolean clientBasicInsertMultipleMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile, IntrospectedTable introspectedTable)
      Description copied from interface: Plugin
      This method is called when the insert multiple method has been generated for the mapper interface. This method is only called in the MyBatis3DynamicSql runtime. This method is only called if the table has generated keys.
      Parameters:
      kotlinFunction - the generated insert function
      kotlinFile - the partially generated file
      introspectedTable - The class containing information about the table as introspected from the database
      Returns:
      true if the method should be generated, false if the generated function should be ignored. In the case of multiple plugins, the first plugin returning false will disable the calling of further plugins.
    • clientInsertMethodGenerated

      public boolean clientInsertMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable)
      Description copied from interface: Plugin
      This method is called when the insert method has been generated in the client interface.
      Parameters:
      method - the generated insert method
      interfaze - the partially implemented client interface. You can add additional imported classes to the interface if necessary.
      introspectedTable - The class containing information about the table as introspected from the database
      Returns:
      true if the method should be generated, false if the generated method should be ignored. In the case of multiple plugins, the first plugin returning false will disable the calling of further plugins.
    • clientInsertMethodGenerated

      public boolean clientInsertMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile, IntrospectedTable introspectedTable)
    • clientInsertMultipleMethodGenerated

      public boolean clientInsertMultipleMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable)
      Description copied from interface: Plugin
      This method is called when the insert multiple method has been generated in the client interface. This method is only called in the MyBatis3DynamicSql runtime.
      Parameters:
      method - the generated insert multiple method
      interfaze - the partially implemented client interface. You can add additional imported classes to the interface if necessary.
      introspectedTable - The class containing information about the table as introspected from the database
      Returns:
      true if the method should be generated, false if the generated method should be ignored. In the case of multiple plugins, the first plugin returning false will disable the calling of further plugins.
    • clientInsertMultipleMethodGenerated

      public boolean clientInsertMultipleMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile, IntrospectedTable introspectedTable)
    • clientInsertSelectiveMethodGenerated

      public boolean clientInsertSelectiveMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable)
      Description copied from interface: Plugin
      This method is called when the insert selective method has been generated in the client interface.
      Parameters:
      method - the generated insert method
      interfaze - the partially implemented client interface. You can add additional imported classes to the interface if necessary.
      introspectedTable - The class containing information about the table as introspected from the database
      Returns:
      true if the method should be generated, false if the generated method should be ignored. In the case of multiple plugins, the first plugin returning false will disable the calling of further plugins.
    • clientInsertSelectiveMethodGenerated

      public boolean clientInsertSelectiveMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile, IntrospectedTable introspectedTable)
    • clientInsertMultipleVarargMethodGenerated

      public boolean clientInsertMultipleVarargMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile, IntrospectedTable introspectedTable)