org.mybatis.generator.ant
Class GeneratorAntTask

java.lang.Object
  extended by Task
      extended by org.mybatis.generator.ant.GeneratorAntTask

public class GeneratorAntTask
extends Task

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:

Author:
Jeff Butler

Constructor Summary
GeneratorAntTask()
           
 
Method Summary
 PropertySet createPropertyset()
           
 void execute()
           
 java.lang.String getConfigfile()
           
 java.lang.String getContextIds()
           
 java.lang.String getFullyQualifiedTableNames()
           
 boolean isOverwrite()
           
 boolean isVerbose()
           
 void setConfigfile(java.lang.String configfile)
           
 void setContextIds(java.lang.String contextIds)
           
 void setFullyQualifiedTableNames(java.lang.String fullyQualifiedTableNames)
           
 void setOverwrite(boolean overwrite)
           
 void setVerbose(boolean verbose)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneratorAntTask

public GeneratorAntTask()
Method Detail

execute

public void execute()
             throws BuildException
Throws:
BuildException

getConfigfile

public java.lang.String getConfigfile()
Returns:
Returns the configfile.

setConfigfile

public void setConfigfile(java.lang.String configfile)
Parameters:
configfile - The configfile to set.

isOverwrite

public boolean isOverwrite()
Returns:
Returns the overwrite.

setOverwrite

public void setOverwrite(boolean overwrite)
Parameters:
overwrite - The overwrite to set.

createPropertyset

public PropertySet createPropertyset()

isVerbose

public boolean isVerbose()

setVerbose

public void setVerbose(boolean verbose)

getContextIds

public java.lang.String getContextIds()

setContextIds

public void setContextIds(java.lang.String contextIds)

getFullyQualifiedTableNames

public java.lang.String getFullyQualifiedTableNames()

setFullyQualifiedTableNames

public void setFullyQualifiedTableNames(java.lang.String fullyQualifiedTableNames)