|
||||||||||
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.VirtualPrimaryKeyPlugin
public class VirtualPrimaryKeyPlugin
This plugin can be used to specify columns that act as a primary key, even if they are not strictly defined as primary keys in the database. To use the plugin, add a property to the table configuration specifying a comma delimited list of column names to use as a primary key:
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 | |
---|---|
VirtualPrimaryKeyPlugin()
|
Method Summary | |
---|---|
void |
initialized(IntrospectedTable introspectedTable)
This method is called just before the getGeneratedXXXFiles methods are called on the introspected table. |
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 VirtualPrimaryKeyPlugin()
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 initialized(IntrospectedTable introspectedTable)
Plugin
A good example of overriding an attribute would be the case where a user wanted to change the name of one of the generated classes, change the target package, or change the name of the generated SQL map file.
Warning: Anything that is listed as an attribute should not be
changed by one of the other plugin methods. For example, if you want to
change the name of a generated example class, you should not simply
change the Type in the modelExampleClassGenerated()
method.
If you do, the change will not be reflected in other generated artifacts.
initialized
in interface Plugin
initialized
in class PluginAdapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |