Package org.apache.openjpa.jdbc.ant
Class ReverseMappingToolTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.MatchingTask
org.apache.openjpa.lib.ant.AbstractTask
org.apache.openjpa.jdbc.ant.ReverseMappingToolTask
- All Implemented Interfaces:
Cloneable,org.apache.tools.ant.types.selectors.SelectorContainer
Executes the
ReverseMappingTool on the specified XML files.
This task can take the following arguments:
packagedirectoryuseSchemaNameuseSchemaElementuseForeignKeyNamenullableAsObjectblobAsObjecttypeMapprimaryKeyOnJoinuseDatastoreIdentityuseBuiltinIdentityClassdetachableinverseRelationsdiscriminatorStrategyversionStrategyinnerIdentityClassesidentityClassSuffixmetadatacustomizerClasscustomizerProperties
codeFormat element with
attributes for the bean properties of the CodeFormat.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected Stringprotected ReverseMappingTool.Flagsprotected StringFields inherited from class org.apache.openjpa.lib.ant.AbstractTask
classpath, fileSets, haltOnError, isolate, useParentFields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
filesetFields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidPerform the task action on the given files.protected ConfigurationImplImplement this method to return a configuration object for the product in use.voidsetAccessType(ReverseMappingToolTask.AccessType accessType) Whether to use field or property-based access on generated code.voidsetBlobAsObject(boolean blobAsObject) Set whether to represent blob columns as Java objects rather than byte[] fields.voidsetCustomizerClass(String customizerClass) Set a customizer class to use.voidsetCustomizerProperties(String customizerProperties) Set a properties file to pass to the customizer class.voidsetDetachable(boolean detachable) Set whether to make generated classes detachable.voidsetDirectory(String dirName) Set the output directory for the generated classes.voidsetDiscriminatorStrategy(String discStrat) Default discriminator strategy for base class mappings.voidsetGenerateAnnotations(boolean genAnnotations) Whether to generate annotations along with generated code.voidsetIdentityClassSuffix(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.voidsetInnerIdentityClasses(boolean innerAppId) Whether or not to generate application identity classes as inner classes.voidsetInverseRelations(boolean inverseRelations) Set whether to generate inverse 1-many/1-1 relations for all many-1/1-1 relations.voidSet the level of the generated metadata.voidsetNullableAsObject(boolean nullableAsObject) Set whether to represent nullable columns as primitive wrappers.voidsetPackage(String pkg) Set the package name for the generated classes.voidsetPrimaryKeyOnJoin(boolean primaryKeyOnJoin) Set whether to allow primary keys on join tables.voidsetTypeMap(String typeMap) Set the SQL type map overrides.voidsetUseBuiltinIdentityClass(boolean useBuiltinIdentityClass) Set whether to use single field identity where possible.voidsetUseDataStoreIdentity(boolean useDataStoreIdentity) Set whether to use datastore identity by default.voidsetUseForeignKeyName(boolean useForeignKeyName) Set whether to use foreign key names to name relations.voidsetUseGenericCollections(boolean useGenericCollections) Set whether to use generic collections on one-to-many and many-to-many relations instead of untyped collections.voidsetUseSchemaElement(boolean useSchemaElement) Set whether to use the schema name in generated filesvoidsetUseSchemaName(boolean useSchemaName) Set whether to use the schema name when naming the classes.voidsetVersionStrategy(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, setUseParentClassloaderMethods 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
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation
-
Field Details
-
flags
-
dirName
-
typeMap
-
customizerProperties
-
customizerClass
-
-
Constructor Details
-
ReverseMappingToolTask
public ReverseMappingToolTask()Default constructor.
-
-
Method Details
-
setPackage
Set the package name for the generated classes. -
setDirectory
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. -
setUseSchemaElement
public void setUseSchemaElement(boolean useSchemaElement) Set whether to use the schema name in generated files -
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. -
setUseGenericCollections
public void setUseGenericCollections(boolean useGenericCollections) Set whether to use generic collections on one-to-many and many-to-many relations instead of untyped collections. -
setTypeMap
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
Default discriminator strategy for base class mappings. -
setVersionStrategy
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
The suffix to use to create the identity class name for a class, or for inner classes, the name of the inner class. -
setMetadata
Set the level of the generated metadata. -
setGenerateAnnotations
public void setGenerateAnnotations(boolean genAnnotations) Whether to generate annotations along with generated code. Defaults to false. -
setAccessType
Whether to use field or property-based access on generated code. Defaults to field-based access. -
setCustomizerClass
Set a customizer class to use. -
setCustomizerProperties
Set a properties file to pass to the customizer class. -
createCodeFormat
-
newConfiguration
Description copied from class:AbstractTaskImplement this method to return a configuration object for the product in use.- Specified by:
newConfigurationin classAbstractTask
-
executeOn
Description copied from class:AbstractTaskPerform the task action on the given files.- Specified by:
executeOnin classAbstractTask- Throws:
Exception
-