org.apache.openjpa.jdbc.ant
Class ReverseMappingToolTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.tools.ant.taskdefs.MatchingTask
              extended by org.apache.openjpa.lib.ant.AbstractTask
                  extended by org.apache.openjpa.jdbc.ant.ReverseMappingToolTask
All Implemented Interfaces:
org.apache.tools.ant.types.selectors.SelectorContainer

public class ReverseMappingToolTask
extends AbstractTask

Executes the ReverseMappingTool on the specified XML files. This task can take the following arguments:

The task also accepts an embedded codeFormat element with attributes for the bean properties of the CodeFormat.


Nested Class Summary
static class ReverseMappingToolTask.Level
           
 
Field Summary
protected  String customizerClass
           
protected  String customizerProperties
           
protected  String dirName
           
protected  ReverseMappingTool.Flags flags
           
protected  String typeMap
           
 
Fields inherited from class org.apache.openjpa.lib.ant.AbstractTask
classpath, fileSets, haltOnError, isolate, useParent
 
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
fileset
 
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
ReverseMappingToolTask()
          Default constructor.
 
Method Summary
 Object createCodeFormat()
           
protected  void executeOn(String[] files)
          Perform the task action on the given files.
protected  ConfigurationImpl newConfiguration()
          Implement this method to return a configuration object for the product in use.
 void setBlobAsObject(boolean blobAsObject)
          Set whether to represent blob columns as Java objects rather than byte[] fields.
 void setCustomizerClass(String customizerClass)
          Set a customizer class to use.
 void setCustomizerProperties(String customizerProperties)
          Set a properties file to pass to the customizer class.
 void setDetachable(boolean detachable)
          Set whether to make generated classes detachable.
 void setDirectory(String dirName)
          Set the output directory for the generated classes.
 void setDiscriminatorStrategy(String discStrat)
          Default discriminator strategy for base class mappings.
 void setIdentityClassSuffix(String suffix)
          The suffix to use to create the identity class name for a class, or for inner classes, the name of the inner class.
 void setInnerIdentityClasses(boolean innerAppId)
          Whether or not to generate application identity classes as inner classes.
 void setInverseRelations(boolean inverseRelations)
          Set whether to generate inverse 1-many/1-1 relations for all many-1/1-1 relations.
 void setMetadata(ReverseMappingToolTask.Level level)
          Set the level of the generated metadata.
 void setNullableAsObject(boolean nullableAsObject)
          Set whether to represent nullable columns as primitive wrappers.
 void setPackage(String pkg)
          Set the package name for the generated classes.
 void setPrimaryKeyOnJoin(boolean primaryKeyOnJoin)
          Set whether to allow primary keys on join tables.
 void setTypeMap(String typeMap)
          Set the SQL type map overrides.
 void setUseBuiltinIdentityClass(boolean useBuiltinIdentityClass)
          Set whether to use single field identity where possible.
 void setUseDataStoreIdentity(boolean useDataStoreIdentity)
          Set whether to use datastore identity by default.
 void setUseForeignKeyName(boolean useForeignKeyName)
          Set whether to use foreign key names to name relations.
 void setUseSchemaName(boolean useSchemaName)
          Set whether to use the schema name when naming the classes.
 void setVersionStrategy(String versionStrat)
          Default version strategy for base class mappings.
 
Methods inherited from class org.apache.openjpa.lib.ant.AbstractTask
addFileset, assertFiles, createClasspath, createConfig, execute, getClassLoader, getConfiguration, setClasspath, setHaltOnError, setIsolate, setUseParentClassloader
 
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, XsetItems
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flags

protected ReverseMappingTool.Flags flags

dirName

protected String dirName

typeMap

protected String typeMap

customizerProperties

protected String customizerProperties

customizerClass

protected String customizerClass
Constructor Detail

ReverseMappingToolTask

public ReverseMappingToolTask()
Default constructor.

Method Detail

setPackage

public void setPackage(String pkg)
Set the package name for the generated classes.


setDirectory

public void setDirectory(String dirName)
Set the output directory for the generated classes.


setUseSchemaName

public void setUseSchemaName(boolean useSchemaName)
Set whether to use the schema name when naming the classes.


setUseForeignKeyName

public void setUseForeignKeyName(boolean useForeignKeyName)
Set whether to use foreign key names to name relations.


setNullableAsObject

public void setNullableAsObject(boolean nullableAsObject)
Set whether to represent nullable columns as primitive wrappers.


setBlobAsObject

public void setBlobAsObject(boolean blobAsObject)
Set whether to represent blob columns as Java objects rather than byte[] fields.


setTypeMap

public void setTypeMap(String typeMap)
Set the SQL type map overrides.


setPrimaryKeyOnJoin

public void setPrimaryKeyOnJoin(boolean primaryKeyOnJoin)
Set whether to allow primary keys on join tables.


setUseDataStoreIdentity

public void setUseDataStoreIdentity(boolean useDataStoreIdentity)
Set whether to use datastore identity by default.


setUseBuiltinIdentityClass

public void setUseBuiltinIdentityClass(boolean useBuiltinIdentityClass)
Set whether to use single field identity where possible.


setInverseRelations

public void setInverseRelations(boolean inverseRelations)
Set whether to generate inverse 1-many/1-1 relations for all many-1/1-1 relations.


setDetachable

public void setDetachable(boolean detachable)
Set whether to make generated classes detachable.


setDiscriminatorStrategy

public void setDiscriminatorStrategy(String discStrat)
Default discriminator strategy for base class mappings.


setVersionStrategy

public void setVersionStrategy(String versionStrat)
Default version strategy for base class mappings.


setInnerIdentityClasses

public void setInnerIdentityClasses(boolean innerAppId)
Whether or not to generate application identity classes as inner classes.


setIdentityClassSuffix

public void setIdentityClassSuffix(String suffix)
The suffix to use to create the identity class name for a class, or for inner classes, the name of the inner class.


setMetadata

public void setMetadata(ReverseMappingToolTask.Level level)
Set the level of the generated metadata.


setCustomizerClass

public void setCustomizerClass(String customizerClass)
Set a customizer class to use.


setCustomizerProperties

public void setCustomizerProperties(String customizerProperties)
Set a properties file to pass to the customizer class.


createCodeFormat

public Object createCodeFormat()

newConfiguration

protected ConfigurationImpl newConfiguration()
Description copied from class: AbstractTask
Implement this method to return a configuration object for the product in use.

Specified by:
newConfiguration in class AbstractTask

executeOn

protected void executeOn(String[] files)
                  throws Exception
Description copied from class: AbstractTask
Perform the task action on the given files.

Specified by:
executeOn in class AbstractTask
Throws:
Exception


Copyright © 2006 Apache Software Foundation. All Rights Reserved.