org.apache.ibatis.abator.config
Class AbatorContext
java.lang.Object
org.apache.ibatis.abator.config.PropertyHolder
org.apache.ibatis.abator.config.AbatorContext
public class AbatorContext
- extends PropertyHolder
- Author:
- Jeff Butler
Constructor Summary |
AbatorContext(java.lang.String generatorSetType,
ModelType defaultModelType)
Constructs an AbatorContext object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbatorContext
public AbatorContext(java.lang.String generatorSetType,
ModelType defaultModelType)
- Constructs an AbatorContext object.
- Parameters:
generatorSetType
- - may be nulldefaultModelType
- - 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()
validate
public void validate(java.util.List errors)
- This method does a simple validate, it makes sure that all required
fields have been filled in and that all implementation classes exist and
are of the proper type. It does not do any more complex operations such
as: Validating that database tables exist or Validating that named
columns exist
generateFiles
public void generateFiles(ProgressCallback callback,
java.util.List generatedJavaFiles,
java.util.List generatedXmlFiles,
java.util.List warnings,
java.util.Set fullyQualifiedTableNames)
throws java.sql.SQLException,
java.lang.InterruptedException
- Generate iBATIS artifacts 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
generatedJavaFiles
- any Java file generated from this method will be added to the List
The objects will be of type GeneratedJavaFile.generatedXmlFiles
- any XML file generated from this method will be added to the List.
The objects will be of type GeneratedXMLFile.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 arrises while introspecting the specified
database tables.
java.lang.InterruptedException
- if the progress callback reports a cancel
getTotalSteps
public int getTotalSteps()
getId
public java.lang.String getId()
setId
public void setId(java.lang.String id)
getGeneratorSet
public GeneratorSet getGeneratorSet()
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 necessarity 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 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
getSuppressTypeWarnings
public boolean getSuppressTypeWarnings()
getCommentGenerator
public CommentGenerator getCommentGenerator()
getCommentGeneratorConfiguration
public CommentGeneratorConfiguration getCommentGeneratorConfiguration()
setCommentGeneratorConfiguration
public void setCommentGeneratorConfiguration(CommentGeneratorConfiguration commentGeneratorConfiguration)