org.apache.ibatis.ibator.config
Class IbatorContext

java.lang.Object
  extended by org.apache.ibatis.ibator.config.PropertyHolder
      extended by org.apache.ibatis.ibator.config.IbatorContext

public class IbatorContext
extends PropertyHolder

Author:
Jeff Butler

Constructor Summary
IbatorContext(ModelType defaultModelType)
          Constructs an IbatorContext object.
 
Method Summary
 void addPluginConfiguration(IbatorPluginConfiguration ibatorPluginConfiguration)
           
 void addProperty(java.lang.String name, java.lang.String value)
           
 void addTableConfiguration(TableConfiguration tc)
           
 void generateFiles(ProgressCallback callback, java.util.List<GeneratedJavaFile> generatedJavaFiles, java.util.List<GeneratedXmlFile> generatedXmlFiles, java.util.List<java.lang.String> warnings)
           
 java.lang.String getBeginningDelimiter()
           
 CommentGenerator getCommentGenerator()
           
 CommentGeneratorConfiguration getCommentGeneratorConfiguration()
           
 DAOGeneratorConfiguration getDaoGeneratorConfiguration()
           
 ModelType getDefaultModelType()
           
 java.lang.String getEndingDelimiter()
           
 int getGenerationSteps()
           
 java.lang.String getId()
           
 java.lang.String getIntrospectedColumnImpl()
           
 int getIntrospectionSteps()
           
 JavaModelGeneratorConfiguration getJavaModelGeneratorConfiguration()
           
 JavaTypeResolverConfiguration getJavaTypeResolverConfiguration()
           
 JDBCConnectionConfiguration getJdbcConnectionConfiguration()
           
 IbatorPlugin getPlugins()
           
 SqlMapGeneratorConfiguration getSqlMapGeneratorConfiguration()
           
 boolean getSuppressTypeWarnings(IntrospectedTable introspectedTable)
           
 java.util.List<TableConfiguration> getTableConfigurations()
           
 java.lang.String getTargetRuntime()
           
 void introspectTables(ProgressCallback callback, java.util.List<java.lang.String> warnings, java.util.Set<java.lang.String> fullyQualifiedTableNames)
          Introspect tables based on the configuration specified in the constructor.
 void setCommentGeneratorConfiguration(CommentGeneratorConfiguration commentGeneratorConfiguration)
           
 void setDaoGeneratorConfiguration(DAOGeneratorConfiguration daoGeneratorConfiguration)
           
 void setId(java.lang.String id)
           
 void setIntrospectedColumnImpl(java.lang.String introspectedColumnImpl)
           
 void setJavaModelGeneratorConfiguration(JavaModelGeneratorConfiguration javaModelGeneratorConfiguration)
           
 void setJavaTypeResolverConfiguration(JavaTypeResolverConfiguration javaTypeResolverConfiguration)
           
 void setJdbcConnectionConfiguration(JDBCConnectionConfiguration jdbcConnectionConfiguration)
           
 void setSqlMapGeneratorConfiguration(SqlMapGeneratorConfiguration sqlMapGeneratorConfiguration)
           
 void setTargetRuntime(java.lang.String targetRuntime)
           
 XmlElement toXmlElement()
          Builds an XmlElement representation of this context.
 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.
 
Methods inherited from class org.apache.ibatis.ibator.config.PropertyHolder
addPropertyXmlElements, getProperties, getProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IbatorContext

public IbatorContext(ModelType defaultModelType)
Constructs an IbatorContext object.

Parameters:
defaultModelType - - may be null
Method Detail

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