Class SchemaToolTask

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.Java
org.datanucleus.store.schema.SchemaToolTask
All Implemented Interfaces:
Cloneable

public class SchemaToolTask extends org.apache.tools.ant.taskdefs.Java
SchemaTool Ant Task. Accepts the following parameters
  • mode Mode of operation ("create", "delete", "deletecreate", "validate", "dbinfo", "schemainfo", etc).
  • verbose Verbose output.
  • props Name of a properties file for use in SchemaTool (PMF properties)
  • ddlFile Name of a file to output the DDL into
  • completeDdl Whether to output complete DDL (otherwise just the missing tables/constraints)
  • persistenceUnit Name of a persistence-unit to manage the schema for
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) List<org.apache.tools.ant.types.FileSet>
    Filesets of files (mapping or class) to be used in generating the schema.
    Operating mode

    Fields inherited from class org.apache.tools.ant.taskdefs.Java

    redirector, redirectorElement

    Fields inherited from class org.apache.tools.ant.Task

    target, taskName, taskType, wrapper

    Fields inherited from class org.apache.tools.ant.ProjectComponent

    description, location, project
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addFileSet(org.apache.tools.ant.types.FileSet fs)
    Add a fileset.
    void
    Execute method, to execute the task.
    protected File[]
     
    void
    Set the API Adapter
    void
    Set the Catalog Name.
    void
    setCompleteDdl(boolean complete)
    Mutator for whether to output complete DDL.
    void
    Set the file to output DDL to
    void
    setIncludeAutoStart(boolean include)
    Mutator for whether to include any auto-start mechanism in schema operations.
    void
    Sets the mode of operation.
    void
    Set the name of the persistence unit to manage
    void
    setProps(String propsFileName)
    Get persistence properties from a file
    void
    Set the Schema Name.
    void
    setVerbose(boolean verbose)
    set verbose

    Methods inherited from class org.apache.tools.ant.taskdefs.Java

    addAssertions, addConfiguredRedirector, addEnv, addSysproperty, addSyspropertyset, checkConfiguration, clearArgs, createArg, createBootclasspath, createClasspath, createJvmarg, createModulepath, createPermissions, createUpgrademodulepath, createWatchdog, executeJava, executeJava, getCommandLine, getSysProperties, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, maybeSetResultPropertyValue, run, setAppend, setArgs, setClassname, setClasspath, setClasspathRef, setCloneVm, setDir, setDiscardError, setDiscardOutput, setError, setErrorProperty, setFailonerror, setFork, setInput, setInputString, setJar, setJvm, setJvmargs, setJVMVersion, setLogError, setMaxmemory, setModule, setModulepath, setModulepathRef, setNewenvironment, setOutput, setOutputproperty, setResultProperty, setSourceFile, setSpawn, setTimeout, setupRedirector

    Methods inherited from class org.apache.tools.ant.Task

    bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType

    Methods inherited from class org.apache.tools.ant.ProjectComponent

    clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • mode

      private SchemaTool.Mode mode
      Operating mode
    • filesets

      List<org.apache.tools.ant.types.FileSet> filesets
      Filesets of files (mapping or class) to be used in generating the schema.
  • Constructor Details

    • SchemaToolTask

      public SchemaToolTask()
      Constructor.
  • Method Details

    • execute

      public void execute() throws org.apache.tools.ant.BuildException
      Execute method, to execute the task.
      Overrides:
      execute in class org.apache.tools.ant.taskdefs.Java
      Throws:
      org.apache.tools.ant.BuildException - if any error happens while running the task
    • addFileSet

      public void addFileSet(org.apache.tools.ant.types.FileSet fs)
      Add a fileset. @see ant manual
      Parameters:
      fs - the FileSet
    • getFiles

      protected File[] getFiles()
    • setVerbose

      public void setVerbose(boolean verbose)
      set verbose
      Parameters:
      verbose - Whether to give verbose output
    • setProps

      public void setProps(String propsFileName)
      Get persistence properties from a file
      Parameters:
      propsFileName - Name of props file
    • setDdlFile

      public void setDdlFile(String file)
      Set the file to output DDL to
      Parameters:
      file - Name of DDL file
    • setCompleteDdl

      public void setCompleteDdl(boolean complete)
      Mutator for whether to output complete DDL.
      Parameters:
      complete - Whether to give complete DDL
    • setIncludeAutoStart

      public void setIncludeAutoStart(boolean include)
      Mutator for whether to include any auto-start mechanism in schema operations.
      Parameters:
      include - Whether to include auto-start mechanisms
    • setPersistenceUnit

      public void setPersistenceUnit(String unitName)
      Set the name of the persistence unit to manage
      Parameters:
      unitName - Name of persistence-unit
    • setApi

      public void setApi(String api)
      Set the API Adapter
      Parameters:
      api - API Adapter
    • setCatalog

      public void setCatalog(String name)
      Set the Catalog Name.
      Parameters:
      name - Catalog name
    • setSchema

      public void setSchema(String name)
      Set the Schema Name.
      Parameters:
      name - Schema name
    • setMode

      public void setMode(String mode)
      Sets the mode of operation.
      Parameters:
      mode - The mode of operation ("create", "delete", "deletecreate", "validate", "dbinfo", "schemainfo")