Class CaseInsensitiveLikePlugin

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

public class CaseInsensitiveLikePlugin extends PluginAdapter
This plugin demonstrates adding methods to the example class to enable case-insensitive LIKE searches. It shows hows to construct new methods and add them to an existing class.

This plugin only adds methods for String fields mapped to a JDBC character type (CHAR, VARCHAR, etc.)

Author:
Jeff Butler
  • Constructor Details

    • CaseInsensitiveLikePlugin

      public CaseInsensitiveLikePlugin()
  • 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
    • modelExampleClassGenerated

      public boolean modelExampleClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable)
      Description copied from interface: Plugin
      This method is called after the example class is generated by the JavaModelGenerator. This method will only be called if the table rules call for generation of an example class.

      This method is only guaranteed to be called by the default Java model generators. Other user supplied generators may, or may not, call this method.
      Parameters:
      topLevelClass - the generated example class
      introspectedTable - The class containing information about the table as introspected from the database
      Returns:
      true if the class should be generated, false if the generated class should be ignored. In the case of multiple plugins, the first plugin returning false will disable the calling of further plugins.