org.mybatis.generator.plugins
Class RowBoundsPlugin

java.lang.Object
  extended by org.mybatis.generator.api.PluginAdapter
      extended by org.mybatis.generator.plugins.RowBoundsPlugin
All Implemented Interfaces:
Plugin

public class RowBoundsPlugin
extends PluginAdapter

This plugin will add selectByExample methods that include rowBounds parameters to the generated mapper interface. This plugin is only valid for MyBatis3.

Author:
Jeff Butler

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.mybatis.generator.api.Plugin
Plugin.ModelClassType
 
Field Summary
 
Fields inherited from class org.mybatis.generator.api.PluginAdapter
context, properties
 
Constructor Summary
RowBoundsPlugin()
           
 
Method Summary
 boolean clientSelectByExampleWithBLOBsMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable)
          This method is called when the selectByExampleWithBLOBs method has been generated in the client interface.
 boolean clientSelectByExampleWithoutBLOBsMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable)
          This method is called when the selectByExampleWithoutBLOBs method has been generated in the client interface.
 boolean sqlMapDocumentGenerated(Document document, IntrospectedTable introspectedTable)
          We'll override this method and add any new elements generated by previous calls
 boolean sqlMapSelectByExampleWithBLOBsElementGenerated(XmlElement element, IntrospectedTable introspectedTable)
          This method is called when the selectByExampleWithBLOBs element is generated.
 boolean sqlMapSelectByExampleWithoutBLOBsElementGenerated(XmlElement element, IntrospectedTable introspectedTable)
          This method is called when the selectByExample element is generated.
 boolean validate(List<String> warnings)
          This method is called after all the setXXX methods are called, but before any other method is called.
 
Methods inherited from class org.mybatis.generator.api.PluginAdapter
clientCountByExampleMethodGenerated, clientCountByExampleMethodGenerated, clientDeleteByExampleMethodGenerated, clientDeleteByExampleMethodGenerated, clientDeleteByPrimaryKeyMethodGenerated, clientDeleteByPrimaryKeyMethodGenerated, clientGenerated, clientInsertMethodGenerated, clientInsertMethodGenerated, clientInsertSelectiveMethodGenerated, clientInsertSelectiveMethodGenerated, clientSelectAllMethodGenerated, clientSelectAllMethodGenerated, clientSelectByExampleWithBLOBsMethodGenerated, clientSelectByExampleWithoutBLOBsMethodGenerated, clientSelectByPrimaryKeyMethodGenerated, clientSelectByPrimaryKeyMethodGenerated, clientUpdateByExampleSelectiveMethodGenerated, clientUpdateByExampleSelectiveMethodGenerated, clientUpdateByExampleWithBLOBsMethodGenerated, clientUpdateByExampleWithBLOBsMethodGenerated, clientUpdateByExampleWithoutBLOBsMethodGenerated, clientUpdateByExampleWithoutBLOBsMethodGenerated, clientUpdateByPrimaryKeySelectiveMethodGenerated, clientUpdateByPrimaryKeySelectiveMethodGenerated, clientUpdateByPrimaryKeyWithBLOBsMethodGenerated, clientUpdateByPrimaryKeyWithBLOBsMethodGenerated, clientUpdateByPrimaryKeyWithoutBLOBsMethodGenerated, clientUpdateByPrimaryKeyWithoutBLOBsMethodGenerated, contextGenerateAdditionalJavaFiles, contextGenerateAdditionalJavaFiles, contextGenerateAdditionalXmlFiles, contextGenerateAdditionalXmlFiles, getContext, getProperties, initialized, modelBaseRecordClassGenerated, modelExampleClassGenerated, modelFieldGenerated, modelGetterMethodGenerated, modelPrimaryKeyClassGenerated, modelRecordWithBLOBsClassGenerated, modelSetterMethodGenerated, providerApplyWhereMethodGenerated, providerCountByExampleMethodGenerated, providerDeleteByExampleMethodGenerated, providerGenerated, providerInsertSelectiveMethodGenerated, providerSelectByExampleWithBLOBsMethodGenerated, providerSelectByExampleWithoutBLOBsMethodGenerated, providerUpdateByExampleSelectiveMethodGenerated, providerUpdateByExampleWithBLOBsMethodGenerated, providerUpdateByExampleWithoutBLOBsMethodGenerated, providerUpdateByPrimaryKeySelectiveMethodGenerated, setContext, setProperties, sqlMapBaseColumnListElementGenerated, sqlMapBlobColumnListElementGenerated, sqlMapCountByExampleElementGenerated, sqlMapDeleteByExampleElementGenerated, sqlMapDeleteByPrimaryKeyElementGenerated, sqlMapExampleWhereClauseElementGenerated, sqlMapGenerated, sqlMapInsertElementGenerated, sqlMapInsertSelectiveElementGenerated, sqlMapResultMapWithBLOBsElementGenerated, sqlMapResultMapWithoutBLOBsElementGenerated, sqlMapSelectAllElementGenerated, sqlMapSelectByPrimaryKeyElementGenerated, sqlMapUpdateByExampleSelectiveElementGenerated, sqlMapUpdateByExampleWithBLOBsElementGenerated, sqlMapUpdateByExampleWithoutBLOBsElementGenerated, sqlMapUpdateByPrimaryKeySelectiveElementGenerated, sqlMapUpdateByPrimaryKeyWithBLOBsElementGenerated, sqlMapUpdateByPrimaryKeyWithoutBLOBsElementGenerated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowBoundsPlugin

public RowBoundsPlugin()
Method Detail

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

clientSelectByExampleWithBLOBsMethodGenerated

public boolean clientSelectByExampleWithBLOBsMethodGenerated(Method method,
                                                             Interface interfaze,
                                                             IntrospectedTable introspectedTable)
Description copied from interface: Plugin
This method is called when the selectByExampleWithBLOBs method has been generated in the client interface.

Specified by:
clientSelectByExampleWithBLOBsMethodGenerated in interface Plugin
Overrides:
clientSelectByExampleWithBLOBsMethodGenerated in class PluginAdapter
Parameters:
method - the generated selectByExampleWithBLOBs 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.

clientSelectByExampleWithoutBLOBsMethodGenerated

public boolean clientSelectByExampleWithoutBLOBsMethodGenerated(Method method,
                                                                Interface interfaze,
                                                                IntrospectedTable introspectedTable)
Description copied from interface: Plugin
This method is called when the selectByExampleWithoutBLOBs method has been generated in the client interface.

Specified by:
clientSelectByExampleWithoutBLOBsMethodGenerated in interface Plugin
Overrides:
clientSelectByExampleWithoutBLOBsMethodGenerated in class PluginAdapter
Parameters:
method - the generated selectByExampleWithoutBLOBs 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.

sqlMapSelectByExampleWithoutBLOBsElementGenerated

public boolean sqlMapSelectByExampleWithoutBLOBsElementGenerated(XmlElement element,
                                                                 IntrospectedTable introspectedTable)
Description copied from interface: Plugin
This method is called when the selectByExample element is generated.

Specified by:
sqlMapSelectByExampleWithoutBLOBsElementGenerated in interface Plugin
Overrides:
sqlMapSelectByExampleWithoutBLOBsElementGenerated in class PluginAdapter
Parameters:
element - the generated <select> element
introspectedTable - The class containing information about the table as introspected from the database
Returns:
true if the element should be generated, false if the generated element should be ignored. In the case of multiple plugins, the first plugin returning false will disable the calling of further plugins.

sqlMapSelectByExampleWithBLOBsElementGenerated

public boolean sqlMapSelectByExampleWithBLOBsElementGenerated(XmlElement element,
                                                              IntrospectedTable introspectedTable)
Description copied from interface: Plugin
This method is called when the selectByExampleWithBLOBs element is generated.

Specified by:
sqlMapSelectByExampleWithBLOBsElementGenerated in interface Plugin
Overrides:
sqlMapSelectByExampleWithBLOBsElementGenerated in class PluginAdapter
Parameters:
element - the generated <select> element
introspectedTable - The class containing information about the table as introspected from the database
Returns:
true if the element should be generated, false if the generated element should be ignored. In the case of multiple plugins, the first plugin returning false will disable the calling of further plugins.

sqlMapDocumentGenerated

public boolean sqlMapDocumentGenerated(Document document,
                                       IntrospectedTable introspectedTable)
We'll override this method and add any new elements generated by previous calls

Specified by:
sqlMapDocumentGenerated in interface Plugin
Overrides:
sqlMapDocumentGenerated in class PluginAdapter
Parameters:
document - the generated document (note that this is the MyBatis generator's internal Document class - not the w3c XML Document class)
introspectedTable - The class containing information about the table as introspected from the database
Returns:
true if the document should be generated, false if the generated document should be ignored. In the case of multiple plugins, the first plugin returning false will disable the calling of further plugins. Also, if any plugin returns false, then the sqlMapGenerated method will not be called.


Copyright © 2010-2012 MyBatis.org. All Rights Reserved.