Top Description Fields Constructors Methods
org.hibernate.tool.hbm2ddl

public Class SchemaUpdateTask

extends MatchingTask
Class Inheritance
Imports
org.hibernate.HibernateException, org.hibernate.cfg.Configuration, .NamingStrategy, org.hibernate.util.ArrayHelper, .ReflectHelper, org.apache.tools.ant.BuildException, .DirectoryScanner, .Project, org.apache.tools.ant.taskdefs.MatchingTask, org.apache.tools.ant.types.FileSet, java.io.File, .FileInputStream, .FileNotFoundException, .IOException, java.util.Iterator, .LinkedList, .List, .Properties

An Ant task for SchemaUpdate.
<taskdef name="schemaupdate"
    classname="org.hibernate.tool.hbm2ddl.SchemaUpdateTask"
    classpathref="class.path"/>

<schemaupdate
    properties="${build.classes.dir}/hibernate.properties"
    quiet="no"
    <fileset dir="${build.classes.dir}">
        <include name="*.hbm.xml"/>
    </fileset>
</schemaupdate>
Author
Rong C Ou, Gavin King
See Also
SchemaUpdate

Field Summary

Modifier and TypeField and Description
private File
private String
private List<E>
private boolean
private String
private File
private File
private boolean
private boolean
Inherited from org.apache.tools.ant.taskdefs.MatchingTask:
fileset

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Execute the task
private Configuration
public String
private String[]
public File
private SchemaUpdate
public boolean
public void
setConfig(File
the file name
configurationFile
)

Set a .cfg.xml file

public void
setDelimiter(String delimiter)

public void
setHaltOnError(boolean haltOnError)

public void
setNamingStrategy(String namingStrategy)

public void
setOutputFile(File outputFile)

public void
setProperties(File
the properties file name
propertiesFile
)

Set a properties file

public void
setQuiet(boolean
true to enable quiet mode
quiet
)

Enable "quiet" mode.

public void
setText(boolean
true to enable text-only mode
text
)

Enable "text-only" mode.

Inherited from org.apache.tools.ant.taskdefs.MatchingTask:
addaddAndaddContainsaddContainsRegexpaddCustomaddDateaddDependaddDepthaddDifferentaddFilenameaddMajorityaddModifiedaddNoneaddNotaddOraddPresentaddSelectoraddSizeaddTypeappendSelectorcreateExcludecreateExcludesFilecreateIncludecreateIncludesFilecreatePatternSetgetDirectoryScannergetImplicitFileSetgetSelectorshasSelectorsselectorCountselectorElementssetCaseSensitivesetDefaultexcludessetExcludessetExcludesfilesetFollowSymlinkssetIncludessetIncludesfilesetProjectXsetIgnoreXsetItems

Field Detail

configurationFileback to summary
private File configurationFile
delimiterback to summary
private String delimiter
fileSetsback to summary
private List<E> fileSets
haltOnErrorback to summary
private boolean haltOnError
namingStrategyback to summary
private String namingStrategy
outputFileback to summary
private File outputFile
propertiesFileback to summary
private File propertiesFile
quietback to summary
private boolean quiet
textback to summary
private boolean text

Constructor Detail

SchemaUpdateTaskback to summary
public SchemaUpdateTask()

Method Detail

addFilesetback to summary
public void addFileset(FileSet set)
executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

Execute the task

Exceptions
BuildException:

Doc from org.apache.tools.ant.Task.execute.

if something goes wrong with the build.

getConfigurationback to summary
private Configuration getConfiguration() throws Exception
getDelimiterback to summary
public String getDelimiter()
getFilesback to summary
private String[] getFiles()
getOutputFileback to summary
public File getOutputFile()
getSchemaUpdateback to summary
private SchemaUpdate getSchemaUpdate(Configuration cfg) throws HibernateException, IOException
isHaltOnErrorback to summary
public boolean isHaltOnError()
setConfigback to summary
public void setConfig(File configurationFile)

Set a .cfg.xml file

Parameters
configurationFile:File

the file name

setDelimiterback to summary
public void setDelimiter(String delimiter)
setHaltOnErrorback to summary
public void setHaltOnError(boolean haltOnError)
setNamingStrategyback to summary
public void setNamingStrategy(String namingStrategy)
setOutputFileback to summary
public void setOutputFile(File outputFile)
setPropertiesback to summary
public void setProperties(File propertiesFile)

Set a properties file

Parameters
propertiesFile:File

the properties file name

setQuietback to summary
public void setQuiet(boolean quiet)

Enable "quiet" mode. The schema will not be written to standard out.

Parameters
quiet:boolean

true to enable quiet mode

setTextback to summary
public void setText(boolean text)

Enable "text-only" mode. The schema will not be updated in the database.

Parameters
text:boolean

true to enable text-only mode