public class MyBatisGenerator extends Object
ConfigurationParser
Constructor and Description |
---|
MyBatisGenerator(Configuration configuration,
ShellCallback shellCallback,
List<String> warnings)
Constructs a MyBatisGenerator object.
|
Modifier and Type | Method and Description |
---|---|
void |
generate(ProgressCallback callback)
This is the main method for generating code.
|
void |
generate(ProgressCallback callback,
Set<String> contextIds)
This is the main method for generating code.
|
void |
generate(ProgressCallback callback,
Set<String> contextIds,
Set<String> fullyQualifiedTableNames)
This is the main method for generating code.
|
void |
generate(ProgressCallback callback,
Set<String> contextIds,
Set<String> fullyQualifiedTableNames,
boolean writeFiles)
This is the main method for generating code.
|
List<GeneratedJavaFile> |
getGeneratedJavaFiles()
Returns the list of generated Java files after a call to one of the generate methods.
|
List<GeneratedKotlinFile> |
getGeneratedKotlinFiles()
Returns the list of generated Kotlin files after a call to one of the generate methods.
|
List<GeneratedXmlFile> |
getGeneratedXmlFiles()
Returns the list of generated XML files after a call to one of the generate methods.
|
public MyBatisGenerator(Configuration configuration, ShellCallback shellCallback, List<String> warnings) throws InvalidConfigurationException
configuration
- The configuration for this invocationshellCallback
- an instance of a ShellCallback interface. You may specify
null
in which case the DefaultShellCallback will
be used.warnings
- Any warnings generated during execution will be added to this
list. Warnings do not affect the running of the tool, but they
may affect the results. A typical warning is an unsupported
data type. In that case, the column will be ignored and
generation will continue. You may specify null
if
you do not want warnings returned.InvalidConfigurationException
- if the specified configuration is invalidpublic void generate(ProgressCallback callback) throws SQLException, IOException, InterruptedException
callback
- an instance of the ProgressCallback interface, or null
if you do not require progress
informationSQLException
- the SQL exceptionIOException
- Signals that an I/O exception has occurred.InterruptedException
- if the method is canceled through the ProgressCallbackpublic void generate(ProgressCallback callback, Set<String> contextIds) throws SQLException, IOException, InterruptedException
callback
- an instance of the ProgressCallback interface, or null
if you do not require progress
informationcontextIds
- a set of Strings containing context ids to run. Only the contexts with an id specified in this list
will be run. If the list is null or empty, than all contexts are run.SQLException
- the SQL exceptionIOException
- Signals that an I/O exception has occurred.InterruptedException
- if the method is canceled through the ProgressCallbackpublic void generate(ProgressCallback callback, Set<String> contextIds, Set<String> fullyQualifiedTableNames) throws SQLException, IOException, InterruptedException
callback
- an instance of the ProgressCallback interface, or null
if you do not require progress
informationcontextIds
- a set of Strings containing context ids to run. Only the contexts with an id specified in this list
will be run. If the list is null or empty, than all contexts are run.fullyQualifiedTableNames
- a set of table names to generate. The elements of the set must be Strings that exactly match what's
specified in the configuration. For example, if table name = "foo" and schema = "bar", then the fully
qualified table name is "foo.bar". If the Set is null or empty, then all tables in the configuration
will be used for code generation.SQLException
- the SQL exceptionIOException
- Signals that an I/O exception has occurred.InterruptedException
- if the method is canceled through the ProgressCallbackpublic void generate(ProgressCallback callback, Set<String> contextIds, Set<String> fullyQualifiedTableNames, boolean writeFiles) throws SQLException, IOException, InterruptedException
callback
- an instance of the ProgressCallback interface, or null
if you do not require progress
informationcontextIds
- a set of Strings containing context ids to run. Only the contexts with an id specified in this list
will be run. If the list is null or empty, than all contexts are run.fullyQualifiedTableNames
- a set of table names to generate. The elements of the set must be Strings that exactly match what's
specified in the configuration. For example, if table name = "foo" and schema = "bar", then the fully
qualified table name is "foo.bar". If the Set is null or empty, then all tables in the configuration
will be used for code generation.writeFiles
- if true, then the generated files will be written to disk. If false,
then the generator runs but nothing is writtenSQLException
- the SQL exceptionIOException
- Signals that an I/O exception has occurred.InterruptedException
- if the method is canceled through the ProgressCallbackpublic List<GeneratedJavaFile> getGeneratedJavaFiles()
public List<GeneratedKotlinFile> getGeneratedKotlinFiles()
public List<GeneratedXmlFile> getGeneratedXmlFiles()
Copyright © 2006–2023 MyBatis.org. All rights reserved.