public class

Context

extends PropertyHolder
java.lang.Object
   ↳ org.mybatis.generator.config.PropertyHolder
     ↳ org.mybatis.generator.config.Context

Summary

Public Constructors
Context(ModelType defaultModelType)
Constructs a Context object.
Public Methods
void addPluginConfiguration(PluginConfiguration pluginConfiguration)
void addProperty(String name, String value)
void addTableConfiguration(TableConfiguration tc)
boolean autoDelimitKeywords()
void generateFiles(ProgressCallback callback, List<GeneratedJavaFile> generatedJavaFiles, List<GeneratedXmlFile> generatedXmlFiles, List<String> warnings)
String getBeginningDelimiter()
CommentGenerator getCommentGenerator()
CommentGeneratorConfiguration getCommentGeneratorConfiguration()
ModelType getDefaultModelType()
String getEndingDelimiter()
int getGenerationSteps()
String getId()
String getIntrospectedColumnImpl()
int getIntrospectionSteps()
JavaClientGeneratorConfiguration getJavaClientGeneratorConfiguration()
JavaModelGeneratorConfiguration getJavaModelGeneratorConfiguration()
JavaTypeResolverConfiguration getJavaTypeResolverConfiguration()
JDBCConnectionConfiguration getJdbcConnectionConfiguration()
Plugin getPlugins()
SqlMapGeneratorConfiguration getSqlMapGeneratorConfiguration()
List<TableConfiguration> getTableConfigurations()
String getTargetRuntime()
void introspectTables(ProgressCallback callback, List<String> warnings, Set<String> fullyQualifiedTableNames)
Introspect tables based on the configuration specified in the constructor.
void setCommentGeneratorConfiguration(CommentGeneratorConfiguration commentGeneratorConfiguration)
void setId(String id)
void setIntrospectedColumnImpl(String introspectedColumnImpl)
void setJavaClientGeneratorConfiguration(JavaClientGeneratorConfiguration javaClientGeneratorConfiguration)
void setJavaModelGeneratorConfiguration(JavaModelGeneratorConfiguration javaModelGeneratorConfiguration)
void setJavaTypeResolverConfiguration(JavaTypeResolverConfiguration javaTypeResolverConfiguration)
void setJdbcConnectionConfiguration(JDBCConnectionConfiguration jdbcConnectionConfiguration)
void setSqlMapGeneratorConfiguration(SqlMapGeneratorConfiguration sqlMapGeneratorConfiguration)
void setTargetRuntime(String targetRuntime)
XmlElement toXmlElement()
Builds an XmlElement representation of this context.
void validate(List<String> errors)
This method does a simple validate, it makes sure that all required fields have been filled in.
[Expand]
Inherited Methods
From class org.mybatis.generator.config.PropertyHolder
From class java.lang.Object

Public Constructors

public Context (ModelType defaultModelType)

Constructs a Context object.

Parameters
defaultModelType - may be null

Public Methods

public void addPluginConfiguration (PluginConfiguration pluginConfiguration)

public void addProperty (String name, String value)

public void addTableConfiguration (TableConfiguration tc)

public boolean autoDelimitKeywords ()

public void generateFiles (ProgressCallback callback, List<GeneratedJavaFile> generatedJavaFiles, List<GeneratedXmlFile> generatedXmlFiles, List<String> warnings)

Throws
InterruptedException

public String getBeginningDelimiter ()

public CommentGenerator getCommentGenerator ()

public CommentGeneratorConfiguration getCommentGeneratorConfiguration ()

public ModelType getDefaultModelType ()

public String getEndingDelimiter ()

public int getGenerationSteps ()

public String getId ()

public String getIntrospectedColumnImpl ()

public int getIntrospectionSteps ()

public JavaClientGeneratorConfiguration getJavaClientGeneratorConfiguration ()

public JavaModelGeneratorConfiguration getJavaModelGeneratorConfiguration ()

public JavaTypeResolverConfiguration getJavaTypeResolverConfiguration ()

public JDBCConnectionConfiguration getJdbcConnectionConfiguration ()

public Plugin getPlugins ()

public SqlMapGeneratorConfiguration getSqlMapGeneratorConfiguration ()

public List<TableConfiguration> getTableConfigurations ()

public String getTargetRuntime ()

public void introspectTables (ProgressCallback callback, List<String> warnings, Set<String> fullyQualifiedTableNames)

Introspect tables based on the configuration specified in the constructor. This method is long running.

Parameters
callback a progress callback if progress information is desired, or null
warnings any warning generated from this method will be added to the List. Warnings are always Strings.
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.
Throws
SQLException if some error arises while introspecting the specified database tables.
InterruptedException if the progress callback reports a cancel

public void setCommentGeneratorConfiguration (CommentGeneratorConfiguration commentGeneratorConfiguration)

public void setId (String id)

public void setIntrospectedColumnImpl (String introspectedColumnImpl)

public void setJavaClientGeneratorConfiguration (JavaClientGeneratorConfiguration javaClientGeneratorConfiguration)

public void setJavaModelGeneratorConfiguration (JavaModelGeneratorConfiguration javaModelGeneratorConfiguration)

public void setJavaTypeResolverConfiguration (JavaTypeResolverConfiguration javaTypeResolverConfiguration)

public void setJdbcConnectionConfiguration (JDBCConnectionConfiguration jdbcConnectionConfiguration)

public void setSqlMapGeneratorConfiguration (SqlMapGeneratorConfiguration sqlMapGeneratorConfiguration)

public void setTargetRuntime (String targetRuntime)

public XmlElement toXmlElement ()

Builds an XmlElement representation of this context. Note that the XML may not necessarily validate if the context is invalid. Call the validate method to check validity of this context.

Returns
  • the XML representation of this context

public void validate (List<String> errors)

This method does a simple validate, it makes sure that all required fields have been filled in. It does not do any more complex operations such as validating that database tables exist or validating that named columns exist