Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.tools
Class DbGeneratorTask

    java.lang.Object
      org.apache.tools.ant.ProjectComponent
          org.apache.tools.ant.Task
              org.apache.cayenne.tools.CayenneTask
                  org.apache.cayenne.tools.DbGeneratorTask

    public class DbGeneratorTask

extends CayenneTask

An Ant Task that is a frontend to Cayenne DbGenerator allowing schema generation from DataMap using Ant.

Since:
  1.2
Author:
  Kevin Menard, Andrus Adamchik

Field Summary
`protected DbAdapter` | `adapter`
`protected boolean` | `createFK`
`protected boolean` | `createPK`
`protected boolean` | `createTables`
`protected String` | `driver`
`protected boolean` | `dropPK`
`protected boolean` | `dropTables`
`protected File` | `map`
`protected String` | `password`
`protected String` | `url`
`protected String` | `userName`

Fields inherited from class org.apache.cayenne.tools.CayenneTask
`classpath`

Fields inherited from class org.apache.tools.ant.Task
`description, location, target, taskName, taskType, wrapper`

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

Constructor Summary
`DbGeneratorTask()`

Method Summary
`void` | `execute()`
`protected DataMap` | `loadDataMap()` Loads and returns DataMap based on `map` attribute.
`void` | `setAdapter(String adapter)` Sets the db adapter.
`void` | `setCreateFK(boolean createFK)`
`void` | `setCreatePK(boolean createPK)`
`void` | `setCreateTables(boolean createTables)`
`void` | `setDriver(String driver)` Sets the JDBC driver used to connect to the database server.
`void` | `setDropPK(boolean dropPK)`
`void` | `setDropTables(boolean dropTables)`
`void` | `setMap(File map)` Sets the map.
`void` | `setPassword(String password)` Sets the password used to connect to the database server.
`void` | `setUrl(String url)` Sets the JDBC URL used to connect to the database server.
`void` | `setUserName(String username)` Sets the username used to connect to the database server.
`protected void` | `validateAttributes()` Validates atttributes that are not related to internal DefaultClassGenerator.

Methods inherited from class org.apache.cayenne.tools.CayenneTask
`setClasspath, setClasspathRef`

Methods 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, setTaskType`

Methods inherited from class org.apache.tools.ant.ProjectComponent
`getProject, setProject`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### adapter

    protected DbAdapter adapter

### map

    protected File map

### driver

    protected String driver

### url

    protected String url

### userName

    protected String userName

### password

    protected String password

### dropTables

    protected boolean dropTables

### dropPK

    protected boolean dropPK

### createTables

    protected boolean createTables

### createPK

    protected boolean createPK

### createFK

    protected boolean createFK

Constructor Detail

### DbGeneratorTask

    public DbGeneratorTask()

Method Detail

### execute

    public void execute()

  Overrides:
    `execute` in class `org.apache.tools.ant.Task`

### validateAttributes

    protected void validateAttributes()
                               throws org.apache.tools.ant.BuildException

  Validates atttributes that are not related to internal DefaultClassGenerator. Throws BuildException if attributes are invalid.

  Throws:
    `org.apache.tools.ant.BuildException`

### loadDataMap

    protected DataMap loadDataMap()
                           throws Exception

  Loads and returns DataMap based on `map` attribute.

  Throws:
    `Exception`

### setCreateFK

    public void setCreateFK(boolean createFK)

### setCreatePK

    public void setCreatePK(boolean createPK)

### setCreateTables

    public void setCreateTables(boolean createTables)

### setDropPK

    public void setDropPK(boolean dropPK)

### setDropTables

    public void setDropTables(boolean dropTables)

### setMap

    public void setMap(File map)

  Sets the map.

  Parameters:
    `map` - The map to set

### setAdapter

    public void setAdapter(String adapter)

  Sets the db adapter.

  Parameters:
    `adapter` - The db adapter to set.

### setDriver

    public void setDriver(String driver)

  Sets the JDBC driver used to connect to the database server.

  Parameters:
    `driver` - The driver to set.

### setUrl

    public void setUrl(String url)

  Sets the JDBC URL used to connect to the database server.

  Parameters:
    `url` - The url to set.

### setUserName

    public void setUserName(String username)

  Sets the username used to connect to the database server.

  Parameters:
    `username` - The username to set.

### setPassword

    public void setPassword(String password)

  Sets the password used to connect to the database server.

  Parameters:
    `password` - The password to set.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2008 Apache Cayenne. All Rights Reserved.