java.lang.Object |
↳ |
org.apache.tools.ant.ProjectComponent |
|
↳ |
org.apache.tools.ant.Task |
|
|
↳ |
org.mybatis.generator.ant.GeneratorAntTask |
Class Overview
This is an Ant task that will run the generator. The following is a sample
Ant script that shows how to run the generator from Ant:
<project default="genfiles" basedir=".">
<property name="generated.source.dir" value="${basedir}" />
<target name="genfiles" description="Generate the files">
<taskdef name="mbgenerator"
classname="org.mybatis.generator.ant.GeneratorAntTask"
classpath="mybatis-generator-core-x.x.x.jar" />
<mbgenerator overwrite="true" configfile="generatorConfig.xml" verbose="false" >
<propertyset>
<propertyref name="generated.source.dir"/>
</propertyset>
</mbgenerator>
</target>
</project>
The task requires that the attribute "configFile" be set to an existing XML
configuration file.
The task supports these optional attributes:
- "overwrite" - if true, then existing Java files will be overwritten. if
false (default), then existing Java files will be untouched and the generator
will write new Java files with a unique name
- "verbose" - if true, then the generator will log progress messages to the
Ant log. Default is false
- "contextIds" - a comma delimited list of contaxtIds to use for this run
- "fullyQualifiedTableNames" - a comma delimited list of fully qualified
table names to use for this run
Public Constructors
public
GeneratorAntTask
()
Public Methods
public
PropertySet
createPropertyset
()
public
String
getConfigfile
()
public
String
getContextIds
()
public
String
getFullyQualifiedTableNames
()
public
boolean
isOverwrite
()
public
boolean
isVerbose
()
public
void
setConfigfile
(String configfile)
Parameters
configfile
| The configfile to set.
|
public
void
setContextIds
(String contextIds)
public
void
setFullyQualifiedTableNames
(String fullyQualifiedTableNames)
public
void
setOverwrite
(boolean overwrite)
Parameters
overwrite
| The overwrite to set.
|
public
void
setVerbose
(boolean verbose)