org.apache.ibatis.ibator.config
Class IbatorContext
java.lang.Object
org.apache.ibatis.ibator.config.PropertyHolder
org.apache.ibatis.ibator.config.IbatorContext
public class IbatorContext
- extends PropertyHolder
- Author:
- Jeff Butler
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IbatorContext
public IbatorContext(ModelType defaultModelType)
- Constructs an IbatorContext object.
- Parameters:
defaultModelType
- -
may be null
addTableConfiguration
public void addTableConfiguration(TableConfiguration tc)
getJdbcConnectionConfiguration
public JDBCConnectionConfiguration getJdbcConnectionConfiguration()
getDaoGeneratorConfiguration
public DAOGeneratorConfiguration getDaoGeneratorConfiguration()
getJavaModelGeneratorConfiguration
public JavaModelGeneratorConfiguration getJavaModelGeneratorConfiguration()
getJavaTypeResolverConfiguration
public JavaTypeResolverConfiguration getJavaTypeResolverConfiguration()
getSqlMapGeneratorConfiguration
public SqlMapGeneratorConfiguration getSqlMapGeneratorConfiguration()
addPluginConfiguration
public void addPluginConfiguration(IbatorPluginConfiguration ibatorPluginConfiguration)
validate
public void validate(java.util.List<java.lang.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
getId
public java.lang.String getId()
setId
public void setId(java.lang.String id)
setDaoGeneratorConfiguration
public void setDaoGeneratorConfiguration(DAOGeneratorConfiguration daoGeneratorConfiguration)
setJavaModelGeneratorConfiguration
public void setJavaModelGeneratorConfiguration(JavaModelGeneratorConfiguration javaModelGeneratorConfiguration)
setJavaTypeResolverConfiguration
public void setJavaTypeResolverConfiguration(JavaTypeResolverConfiguration javaTypeResolverConfiguration)
setJdbcConnectionConfiguration
public void setJdbcConnectionConfiguration(JDBCConnectionConfiguration jdbcConnectionConfiguration)
setSqlMapGeneratorConfiguration
public void setSqlMapGeneratorConfiguration(SqlMapGeneratorConfiguration sqlMapGeneratorConfiguration)
getDefaultModelType
public ModelType getDefaultModelType()
toXmlElement
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
getTableConfigurations
public java.util.List<TableConfiguration> getTableConfigurations()
getBeginningDelimiter
public java.lang.String getBeginningDelimiter()
getEndingDelimiter
public java.lang.String getEndingDelimiter()
addProperty
public void addProperty(java.lang.String name,
java.lang.String value)
- Overrides:
addProperty
in class PropertyHolder
getCommentGenerator
public CommentGenerator getCommentGenerator()
getCommentGeneratorConfiguration
public CommentGeneratorConfiguration getCommentGeneratorConfiguration()
setCommentGeneratorConfiguration
public void setCommentGeneratorConfiguration(CommentGeneratorConfiguration commentGeneratorConfiguration)
getPlugins
public IbatorPlugin getPlugins()
getTargetRuntime
public java.lang.String getTargetRuntime()
setTargetRuntime
public void setTargetRuntime(java.lang.String targetRuntime)
getIntrospectedColumnImpl
public java.lang.String getIntrospectedColumnImpl()
setIntrospectedColumnImpl
public void setIntrospectedColumnImpl(java.lang.String introspectedColumnImpl)
getSuppressTypeWarnings
public boolean getSuppressTypeWarnings(IntrospectedTable introspectedTable)
getIntrospectionSteps
public int getIntrospectionSteps()
introspectTables
public void introspectTables(ProgressCallback callback,
java.util.List<java.lang.String> warnings,
java.util.Set<java.lang.String> fullyQualifiedTableNames)
throws java.sql.SQLException,
java.lang.InterruptedException
- 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:
java.sql.SQLException
- if some error arises while introspecting the specified
database tables.
java.lang.InterruptedException
- if the progress callback reports a cancel
getGenerationSteps
public int getGenerationSteps()
generateFiles
public void generateFiles(ProgressCallback callback,
java.util.List<GeneratedJavaFile> generatedJavaFiles,
java.util.List<GeneratedXmlFile> generatedXmlFiles,
java.util.List<java.lang.String> warnings)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException