Package org.hibernate.tool.hbm2ddl
Class SchemaExportTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.MatchingTask
org.hibernate.tool.hbm2ddl.SchemaExportTask
- All Implemented Interfaces:
org.apache.tools.ant.types.selectors.SelectorContainer
An Ant task for SchemaExport.
<taskdef name="schemaexport"
classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
classpathref="class.path"/>
<schemaexport
properties="${build.classes.dir}/hibernate.properties"
quiet="no"
text="no"
drop="no"
delimiter=";"
output="${build.dir}/schema-export.sql">
<fileset dir="${build.classes.dir}">
<include name="*.hbm.xml"/>
</fileset>
</schemaexport>
- See Also:
-
Field Summary
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
filesetFields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidexecute()Execute the taskvoidSet a.cfg.xml file, which will be loaded as a resource, from the classpathvoidsetCreate(boolean create) Enable "create" mode.voidsetDelimiter(String delimiter) Set the end of statement delimiter for the generated scriptvoidsetDrop(boolean drop) Enable "drop" mode.voidsetHaltonerror(boolean haltOnError) voidsetNamingStrategy(String namingStrategy) voidSet the script output filevoidsetProperties(File propertiesFile) Set a properties filevoidsetQuiet(boolean quiet) Enable "quiet" mode.voidsetText(boolean text) Enable "text-only" mode.Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItemsMethods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
getProject
-
Constructor Details
-
SchemaExportTask
public SchemaExportTask()
-
-
Method Details
-
addFileset
-
setProperties
Set a properties file- Parameters:
propertiesFile- the properties file name
-
setConfig
Set a.cfg.xml file, which will be loaded as a resource, from the classpath- Parameters:
configurationFile- the path to the resource
-
setQuiet
public void setQuiet(boolean quiet) Enable "quiet" mode. The schema will not be written to standard out.- Parameters:
quiet- true to enable quiet mode
-
setText
public void setText(boolean text) Enable "text-only" mode. The schema will not be exported to the database.- Parameters:
text- true to enable text-only mode
-
setDrop
public void setDrop(boolean drop) Enable "drop" mode. Database objects will be dropped but not recreated.- Parameters:
drop- true to enable drop mode
-
setCreate
public void setCreate(boolean create) Enable "create" mode. Database objects will be created but not first dropped.- Parameters:
create- true to enable create mode
-
setDelimiter
Set the end of statement delimiter for the generated script- Parameters:
delimiter- the delimiter
-
setOutput
Set the script output file- Parameters:
outputFile- the file name
-
execute
Execute the task- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException
-
setNamingStrategy
-
setHaltonerror
public void setHaltonerror(boolean haltOnError)
-