public class SerializablePlugin extends PluginAdapter
This plugin demonstrates adding capabilities to generated Java artifacts, and shows the proper way to add imports to a compilation unit.
Important: This is a simplistic implementation of serializable and does not attempt to do any versioning of classes.
Plugin.ModelClassType
context, properties
Constructor and Description |
---|
SerializablePlugin() |
Modifier and Type | Method and Description |
---|---|
protected void |
makeSerializable(TopLevelClass topLevelClass,
IntrospectedTable introspectedTable) |
boolean |
modelBaseRecordClassGenerated(TopLevelClass topLevelClass,
IntrospectedTable introspectedTable)
This method is called after the base record class is generated by the
JavaModelGenerator.
|
boolean |
modelPrimaryKeyClassGenerated(TopLevelClass topLevelClass,
IntrospectedTable introspectedTable)
This method is called after the primary key class is generated by the
JavaModelGenerator.
|
boolean |
modelRecordWithBLOBsClassGenerated(TopLevelClass topLevelClass,
IntrospectedTable introspectedTable)
This method is called after the record with BLOBs class is generated by
the JavaModelGenerator.
|
void |
setProperties(Properties properties)
Set properties from the plugin configuration
|
boolean |
validate(List<String> warnings)
This method is called after all the setXXX methods are called, but before
any other method is called.
|
clientCountByExampleMethodGenerated, clientCountByExampleMethodGenerated, clientDeleteByExampleMethodGenerated, clientDeleteByExampleMethodGenerated, clientDeleteByPrimaryKeyMethodGenerated, clientDeleteByPrimaryKeyMethodGenerated, clientGenerated, clientInsertMethodGenerated, clientInsertMethodGenerated, clientInsertSelectiveMethodGenerated, clientInsertSelectiveMethodGenerated, clientSelectAllMethodGenerated, clientSelectAllMethodGenerated, clientSelectByExampleWithBLOBsMethodGenerated, clientSelectByExampleWithBLOBsMethodGenerated, clientSelectByExampleWithoutBLOBsMethodGenerated, clientSelectByExampleWithoutBLOBsMethodGenerated, clientSelectByPrimaryKeyMethodGenerated, clientSelectByPrimaryKeyMethodGenerated, clientUpdateByExampleSelectiveMethodGenerated, clientUpdateByExampleSelectiveMethodGenerated, clientUpdateByExampleWithBLOBsMethodGenerated, clientUpdateByExampleWithBLOBsMethodGenerated, clientUpdateByExampleWithoutBLOBsMethodGenerated, clientUpdateByExampleWithoutBLOBsMethodGenerated, clientUpdateByPrimaryKeySelectiveMethodGenerated, clientUpdateByPrimaryKeySelectiveMethodGenerated, clientUpdateByPrimaryKeyWithBLOBsMethodGenerated, clientUpdateByPrimaryKeyWithBLOBsMethodGenerated, clientUpdateByPrimaryKeyWithoutBLOBsMethodGenerated, clientUpdateByPrimaryKeyWithoutBLOBsMethodGenerated, contextGenerateAdditionalJavaFiles, contextGenerateAdditionalJavaFiles, contextGenerateAdditionalXmlFiles, contextGenerateAdditionalXmlFiles, getContext, getProperties, initialized, modelExampleClassGenerated, modelFieldGenerated, modelGetterMethodGenerated, modelSetterMethodGenerated, providerApplyWhereMethodGenerated, providerCountByExampleMethodGenerated, providerDeleteByExampleMethodGenerated, providerGenerated, providerInsertSelectiveMethodGenerated, providerSelectByExampleWithBLOBsMethodGenerated, providerSelectByExampleWithoutBLOBsMethodGenerated, providerUpdateByExampleSelectiveMethodGenerated, providerUpdateByExampleWithBLOBsMethodGenerated, providerUpdateByExampleWithoutBLOBsMethodGenerated, providerUpdateByPrimaryKeySelectiveMethodGenerated, setContext, sqlMapBaseColumnListElementGenerated, sqlMapBlobColumnListElementGenerated, sqlMapCountByExampleElementGenerated, sqlMapDeleteByExampleElementGenerated, sqlMapDeleteByPrimaryKeyElementGenerated, sqlMapDocumentGenerated, sqlMapExampleWhereClauseElementGenerated, sqlMapGenerated, sqlMapInsertElementGenerated, sqlMapInsertSelectiveElementGenerated, sqlMapResultMapWithBLOBsElementGenerated, sqlMapResultMapWithoutBLOBsElementGenerated, sqlMapSelectAllElementGenerated, sqlMapSelectByExampleWithBLOBsElementGenerated, sqlMapSelectByExampleWithoutBLOBsElementGenerated, sqlMapSelectByPrimaryKeyElementGenerated, sqlMapUpdateByExampleSelectiveElementGenerated, sqlMapUpdateByExampleWithBLOBsElementGenerated, sqlMapUpdateByExampleWithoutBLOBsElementGenerated, sqlMapUpdateByPrimaryKeySelectiveElementGenerated, sqlMapUpdateByPrimaryKeyWithBLOBsElementGenerated, sqlMapUpdateByPrimaryKeyWithoutBLOBsElementGenerated
public boolean validate(List<String> warnings)
Plugin
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.public void setProperties(Properties properties)
Plugin
setProperties
in interface Plugin
setProperties
in class PluginAdapter
public boolean modelBaseRecordClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable)
Plugin
modelBaseRecordClassGenerated
in interface Plugin
modelBaseRecordClassGenerated
in class PluginAdapter
topLevelClass
- the generated base record classintrospectedTable
- The class containing information about the table as
introspected from the databasepublic boolean modelPrimaryKeyClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable)
Plugin
modelPrimaryKeyClassGenerated
in interface Plugin
modelPrimaryKeyClassGenerated
in class PluginAdapter
topLevelClass
- the generated primary key classintrospectedTable
- The class containing information about the table as
introspected from the databasepublic boolean modelRecordWithBLOBsClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable)
Plugin
modelRecordWithBLOBsClassGenerated
in interface Plugin
modelRecordWithBLOBsClassGenerated
in class PluginAdapter
topLevelClass
- the generated record with BLOBs classintrospectedTable
- The class containing information about the table as
introspected from the databaseprotected void makeSerializable(TopLevelClass topLevelClass, IntrospectedTable introspectedTable)
Copyright © 2010–2018 MyBatis.org. All rights reserved.