|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mybatis.generator.api.PluginAdapter
org.mybatis.generator.plugins.SerializablePlugin
public class SerializablePlugin
This plugin adds the java.io.Serializable marker interface to all generated model objects.
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.
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 | |
---|---|
SerializablePlugin()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SerializablePlugin()
Method Detail |
---|
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 database
public 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 database
public 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 database
protected void makeSerializable(TopLevelClass topLevelClass, IntrospectedTable introspectedTable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |