Package org.apache.openjpa.jdbc.meta
Class ReverseMappingTool
- java.lang.Object
-
- org.apache.openjpa.jdbc.meta.ReverseMappingTool
-
- All Implemented Interfaces:
java.lang.Cloneable
,MetaDataModes
public class ReverseMappingTool extends java.lang.Object implements MetaDataModes, java.lang.Cloneable
Reverse-maps a schema into class mappings and the associated java code. Generates a Java code files for persistent classes and associated identity classes and metadata.- Author:
- Abe White
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReverseMappingTool.Flags
Holder for run flags.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACCESS_TYPE_FIELD
Access type for generated source, defaults to field-based access.static java.lang.String
ACCESS_TYPE_PROPERTY
static java.lang.String
LEVEL_CLASS
static java.lang.String
LEVEL_NONE
static java.lang.String
LEVEL_PACKAGE
static int
TABLE_ASSOCIATION
Association table.static int
TABLE_BASE
Primary table for a new base class.static int
TABLE_NONE
Unmapped table.static int
TABLE_SECONDARY
Secondary table of an existing class.static int
TABLE_SECONDARY_OUTER
Secondary table of an existing class.static int
TABLE_SUBCLASS
Subclass table.-
Fields inherited from interface org.apache.openjpa.meta.MetaDataModes
MODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY
-
-
Constructor Summary
Constructors Constructor Description ReverseMappingTool(JDBCConfiguration conf)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConstraints(ValueMapping vm)
Add existing unique constraints and indexes to the given value.void
addJoinConstraints(FieldMapping field)
Add existing unique constraints and indexes to the given field's join.void
buildAnnotations()
java.lang.Object
clone()
Return a new tool with the same settings as this one.java.lang.Class
generateClass(java.lang.String name, java.lang.Class parent)
Generate a new class with the given name.java.lang.String
getAccessType()
Whether to use field or property-based access on generated code.java.util.List
getAnnotationsForMeta(java.lang.Object meta)
Returns a list of stringified annotations for specified meta.boolean
getBlobAsObject()
Whether to reverse-map blob columns as containing serialized Java objects, rather than the default of using a byte[] field.ClassMapping
getClassMapping(Table table)
Return the class mapping for the given table, or null if none.CodeFormat
getCodeFormat()
The code formatter for the generated Java code.JDBCConfiguration
getConfiguration()
Return the configuration provided on construction.ReverseCustomizer
getCustomizer()
Return the customizer in use, or null if none.boolean
getDetachable()
Whether to make generated classes detachable.java.io.File
getDirectory()
The file to output the generated code to, or null for the current directory.java.lang.String
getDiscriminatorStrategy()
Default discriminator strategy for base class mappings.java.lang.String
getFieldName(java.lang.String name, ClassMapping dec)
Return a default Java identifier-formatted name for the given column/table name.java.lang.Class
getFieldType(Column col, boolean forceObject)
Return the default field type for the given column.boolean
getGenerateAnnotations()
Whether to generate annotations along with generated code.java.lang.String
getIdentityClassSuffix()
Suffix used to create application identity class name from a class name, or in the case of inner identity classes, the inner class name.boolean
getInnerIdentityClasses()
Whether or not to generate inner classes when creating application identity classes.boolean
getInverseRelations()
Whether to generate inverse 1-many/1-1 relations for all many-1/1-1 relations.Log
getLog()
Return the log to write to.ClassMapping[]
getMappings()
Return the generated mappings.boolean
getNullableAsObject()
Return whether even nullable columns will be mapped to wrappers rather than primitives.java.lang.String
getPackageName()
Return the default package for the generated classes, or null if unset.boolean
getPrimaryKeyOnJoin()
Return true if join tables are allowed to have primary keys, false if all primary key tables will be mapped as persistent classes.MappingRepository
getRepository()
Return the mapping repository used to hold generated mappings.SchemaGroup
getSchemaGroup()
Return the schema group to reverse map.java.util.Properties
getTypeMap()
Map of JDBC-name to Java-type-name entries that allows customization of reverse mapping columns to field types.ForeignKey
getUniqueForeignKey(Table table)
If the given table has a single unique foreign key or a foreign key that matches the primary key, return it.boolean
getUseBuiltinIdentityClass()
Whether to use built in identity classes when possible.boolean
getUseDataStoreIdentity()
Whether to use datastore identity when possible.boolean
getUseForeignKeyName()
Return whether the foreign key name will be used to generate relation names.boolean
getUseGenericCollections()
Whether to use generic collections on one-to-many and many-to-many relations instead of untyped collections.boolean
getUseSchemaElement()
Returns whether or not the schema name will be included in the @Table annotation within the generated class for each table, as well as the corresponding XML mapping files.boolean
getUseSchemaName()
Return true if the schema name will be included in the generated class name for each table.java.lang.String
getVersionStrategy()
Default version strategy for base class mappings.boolean
isBaseTable(Table table)
Return whether the given table is a base class table.boolean
isUnique(ForeignKey fk)
Return whether the given foreign key is unique.static void
main(java.lang.String[] args)
Usage: java org.apache.openjpa.jdbc.meta.ReverseMappingTool [option]* <.schema file or resource>* Where the following options are recognized.ClassMapping
newClassMapping(java.lang.Class cls, Table table)
Create a new class to be mapped to a table.FieldMapping
newFieldMapping(java.lang.String name, java.lang.Class type, Column col, ForeignKey fk, ClassMapping dec)
Create a field mapping for the given info, or return null if customizer rejects.protected static ReverseMappingTool
newInstance(JDBCConfiguration conf)
java.util.List
recordCode()
UsesCodeGenerator
s to write the Java code for the generated mappings to the proper packages.java.util.List
recordCode(java.util.Map<java.lang.Class<?>,java.lang.String> output)
Write the code for the tool.java.util.Collection
recordMetaData(boolean perClass)
Write the generated metadata to the proper packages.java.util.Collection
recordMetaData(boolean perClass, java.util.Map output)
Write the code for the tool.void
run()
Generate mappings and class code for the current schema group.static void
run(JDBCConfiguration conf, java.lang.String[] args, ReverseMappingTool.Flags flags, java.lang.ClassLoader loader)
Run the tool.static void
run(JDBCConfiguration conf, java.lang.String[] args, ReverseMappingTool.Flags flags, java.lang.ClassLoader loader, java.util.Map<java.lang.Class<?>,java.lang.String> output)
Run the tool and write to the optionally provided mapstatic boolean
run(JDBCConfiguration conf, java.lang.String[] args, Options opts)
Run the tool.static boolean
run(JDBCConfiguration conf, java.lang.String[] args, Options opts, java.util.Map<java.lang.Class<?>,java.lang.String> output)
Run the tool and write to the optionally provided map.void
setAccessType(java.lang.String accessType)
Whether to use field or property-based access on generated code.void
setBlobAsObject(boolean blobAsObj)
Whether to reverse-map blob columns as containing serialized Java objects, rather than the default of using a byte[] field.void
setCodeFormat(CodeFormat format)
Set the code formatter for the generated Java code.void
setCustomizer(ReverseCustomizer customizer)
Set the customizer.void
setDetachable(boolean detachable)
Whether to make generated classes detachable.void
setDirectory(java.io.File dir)
The file to output the generated code to, or null for the current directory.void
setDiscriminatorStrategy(java.lang.String discStrat)
Default discriminator strategy for base class mappings.void
setGenerateAnnotations(boolean genAnnotations)
Whether to generate annotations along with generated code.void
setIdentityClassSuffix(java.lang.String suffix)
Suffix used to create application identity class name from a class name, or in the case of inner identity classes, the inner class name.void
setInnerIdentityClasses(boolean inner)
Whether or not to generate inner classes when creating application identity classes.void
setInverseRelations(boolean inverse)
Whether to generate inverse 1-many/1-1 relations for all many-1/1-1 relations.void
setNullableAsObject(boolean nullAsObj)
Set whether even nullable columns will be mapped to wrappers rather than primitives.void
setPackageName(java.lang.String packageName)
Set the default package for the generated classes; use null to indicate no package.void
setPrimaryKeyOnJoin(boolean pkOnJoin)
Set to true if join tables are allowed to have primary keys, false if all primary key tables will be mapped as persistent classes.void
setRepository(MappingRepository repos)
Set the repository to use.void
setSchemaGroup(SchemaGroup schema)
Set the schema to reverse map.void
setTypeMap(java.util.Properties typeMap)
Map of JDBC-name to Java-type-name entries that allows customization of reverse mapping columns to field types.void
setUseBuiltinIdentityClass(boolean builtin)
Whether to use built in identity classes when possible.void
setUseDataStoreIdentity(boolean datastore)
Whether to use datastore identity when possible.void
setUseForeignKeyName(boolean useFK)
Set whether the foreign key name will be used to generate relation names.void
setUseGenericCollections(boolean useGenericCollections)
Whether to use generic collections on one-to-many and many-to-many relations instead of untyped collections.void
setUseSchemaElement(boolean useSchemaElement)
Sets whether or not the schema name will be included in the @Table annotation within the generated class for each table, as well as the corresponding XML mapping files.void
setUseSchemaName(boolean useSchema)
Set whether the schema name will be included in the generated class name for each table.void
setVersionStrategy(java.lang.String versionStrat)
Default version strategy for base class mappings.
-
-
-
Field Detail
-
TABLE_NONE
public static final int TABLE_NONE
Unmapped table.- See Also:
- Constant Field Values
-
TABLE_BASE
public static final int TABLE_BASE
Primary table for a new base class.- See Also:
- Constant Field Values
-
TABLE_SECONDARY
public static final int TABLE_SECONDARY
Secondary table of an existing class. There is exactly one row in this table for each row in the primary table.- See Also:
- Constant Field Values
-
TABLE_SECONDARY_OUTER
public static final int TABLE_SECONDARY_OUTER
Secondary table of an existing class. There is zero or one row in this table for each row in the primary table.- See Also:
- Constant Field Values
-
TABLE_ASSOCIATION
public static final int TABLE_ASSOCIATION
Association table.- See Also:
- Constant Field Values
-
TABLE_SUBCLASS
public static final int TABLE_SUBCLASS
Subclass table.- See Also:
- Constant Field Values
-
LEVEL_NONE
public static final java.lang.String LEVEL_NONE
- See Also:
- Constant Field Values
-
LEVEL_PACKAGE
public static final java.lang.String LEVEL_PACKAGE
- See Also:
- Constant Field Values
-
LEVEL_CLASS
public static final java.lang.String LEVEL_CLASS
- See Also:
- Constant Field Values
-
ACCESS_TYPE_FIELD
public static final java.lang.String ACCESS_TYPE_FIELD
Access type for generated source, defaults to field-based access.- See Also:
- Constant Field Values
-
ACCESS_TYPE_PROPERTY
public static final java.lang.String ACCESS_TYPE_PROPERTY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ReverseMappingTool
public ReverseMappingTool(JDBCConfiguration conf)
Constructor. Supply configuration.
-
-
Method Detail
-
getConfiguration
public JDBCConfiguration getConfiguration()
Return the configuration provided on construction.
-
getLog
public Log getLog()
Return the log to write to.
-
getPackageName
public java.lang.String getPackageName()
Return the default package for the generated classes, or null if unset.
-
setPackageName
public void setPackageName(java.lang.String packageName)
Set the default package for the generated classes; use null to indicate no package.
-
getDirectory
public java.io.File getDirectory()
The file to output the generated code to, or null for the current directory. If the directory matches the package, it will be used. Otherwise, the package structure will be created under this directory.
-
setDirectory
public void setDirectory(java.io.File dir)
The file to output the generated code to, or null for the current directory. If the directory matches the package, it will be used. Otherwise, the package structure will be created under this directory.
-
getUseSchemaName
public boolean getUseSchemaName()
Return true if the schema name will be included in the generated class name for each table. Defaults to false.
-
setUseSchemaName
public void setUseSchemaName(boolean useSchema)
Set whether the schema name will be included in the generated class name for each table. Defaults to false.
-
getUseForeignKeyName
public boolean getUseForeignKeyName()
Return whether the foreign key name will be used to generate relation names. Defaults to false.
-
setUseForeignKeyName
public void setUseForeignKeyName(boolean useFK)
Set whether the foreign key name will be used to generate relation names. Defaults to false.
-
getNullableAsObject
public boolean getNullableAsObject()
Return whether even nullable columns will be mapped to wrappers rather than primitives. Defaults to false.
-
setNullableAsObject
public void setNullableAsObject(boolean nullAsObj)
Set whether even nullable columns will be mapped to wrappers rather than primitives. Defaults to false.
-
getBlobAsObject
public boolean getBlobAsObject()
Whether to reverse-map blob columns as containing serialized Java objects, rather than the default of using a byte[] field.
-
setBlobAsObject
public void setBlobAsObject(boolean blobAsObj)
Whether to reverse-map blob columns as containing serialized Java objects, rather than the default of using a byte[] field.
-
getUseGenericCollections
public boolean getUseGenericCollections()
Whether to use generic collections on one-to-many and many-to-many relations instead of untyped collections.
-
setUseGenericCollections
public void setUseGenericCollections(boolean useGenericCollections)
Whether to use generic collections on one-to-many and many-to-many relations instead of untyped collections.
-
getTypeMap
public java.util.Properties getTypeMap()
Map of JDBC-name to Java-type-name entries that allows customization of reverse mapping columns to field types.
-
setTypeMap
public void setTypeMap(java.util.Properties typeMap)
Map of JDBC-name to Java-type-name entries that allows customization of reverse mapping columns to field types.
-
getPrimaryKeyOnJoin
public boolean getPrimaryKeyOnJoin()
Return true if join tables are allowed to have primary keys, false if all primary key tables will be mapped as persistent classes. Defaults to false.
-
setPrimaryKeyOnJoin
public void setPrimaryKeyOnJoin(boolean pkOnJoin)
Set to true if join tables are allowed to have primary keys, false if all primary key tables will be mapped as persistent classes. Defaults to false.
-
getUseDataStoreIdentity
public boolean getUseDataStoreIdentity()
Whether to use datastore identity when possible. Defaults to false.
-
setUseDataStoreIdentity
public void setUseDataStoreIdentity(boolean datastore)
Whether to use datastore identity when possible. Defaults to false.
-
getUseBuiltinIdentityClass
public boolean getUseBuiltinIdentityClass()
Whether to use built in identity classes when possible. Defaults to true.
-
setUseBuiltinIdentityClass
public void setUseBuiltinIdentityClass(boolean builtin)
Whether to use built in identity classes when possible. Defaults to true.
-
getInnerIdentityClasses
public boolean getInnerIdentityClasses()
Whether or not to generate inner classes when creating application identity classes.
-
setInnerIdentityClasses
public void setInnerIdentityClasses(boolean inner)
Whether or not to generate inner classes when creating application identity classes.
-
getIdentityClassSuffix
public java.lang.String getIdentityClassSuffix()
Suffix used to create application identity class name from a class name, or in the case of inner identity classes, the inner class name.
-
setIdentityClassSuffix
public void setIdentityClassSuffix(java.lang.String suffix)
Suffix used to create application identity class name from a class name, or in the case of inner identity classes, the inner class name.
-
getInverseRelations
public boolean getInverseRelations()
Whether to generate inverse 1-many/1-1 relations for all many-1/1-1 relations. Defaults to true.
-
setInverseRelations
public void setInverseRelations(boolean inverse)
Whether to generate inverse 1-many/1-1 relations for all many-1/1-1 relations. Defaults to true.
-
getDetachable
public boolean getDetachable()
Whether to make generated classes detachable. Defaults to false.
-
setDetachable
public void setDetachable(boolean detachable)
Whether to make generated classes detachable. Defaults to false.
-
getDiscriminatorStrategy
public java.lang.String getDiscriminatorStrategy()
Default discriminator strategy for base class mappings.
-
setDiscriminatorStrategy
public void setDiscriminatorStrategy(java.lang.String discStrat)
Default discriminator strategy for base class mappings.
-
getVersionStrategy
public java.lang.String getVersionStrategy()
Default version strategy for base class mappings.
-
setVersionStrategy
public void setVersionStrategy(java.lang.String versionStrat)
Default version strategy for base class mappings.
-
getGenerateAnnotations
public boolean getGenerateAnnotations()
Whether to generate annotations along with generated code. Defaults to false.
-
setGenerateAnnotations
public void setGenerateAnnotations(boolean genAnnotations)
Whether to generate annotations along with generated code. Defaults to false.
-
getAccessType
public java.lang.String getAccessType()
Whether to use field or property-based access on generated code. Defaults to field-based access.
-
setAccessType
public void setAccessType(java.lang.String accessType)
Whether to use field or property-based access on generated code. Defaults to field-based access.
-
getCodeFormat
public CodeFormat getCodeFormat()
The code formatter for the generated Java code.
-
setCodeFormat
public void setCodeFormat(CodeFormat format)
Set the code formatter for the generated Java code.
-
getCustomizer
public ReverseCustomizer getCustomizer()
Return the customizer in use, or null if none.
-
setCustomizer
public void setCustomizer(ReverseCustomizer customizer)
Set the customizer. The configuration on the customizer, if any, should already be set.
-
getUseSchemaElement
public boolean getUseSchemaElement()
Returns whether or not the schema name will be included in the @Table annotation within the generated class for each table, as well as the corresponding XML mapping files. The initialized value is true (in order to preserve backwards compatibility).
-
setUseSchemaElement
public void setUseSchemaElement(boolean useSchemaElement)
Sets whether or not the schema name will be included in the @Table annotation within the generated class for each table, as well as the corresponding XML mapping files.
-
getRepository
public MappingRepository getRepository()
Return the mapping repository used to hold generated mappings. You can also use the repository to seed the schema group to generate classes from.
-
setRepository
public void setRepository(MappingRepository repos)
Set the repository to use.
-
getSchemaGroup
public SchemaGroup getSchemaGroup()
Return the schema group to reverse map. If none has been set, the schema will be generated from the database.
-
setSchemaGroup
public void setSchemaGroup(SchemaGroup schema)
Set the schema to reverse map.
-
getMappings
public ClassMapping[] getMappings()
Return the generated mappings.
-
run
public void run()
Generate mappings and class code for the current schema group.
-
recordCode
public java.util.List recordCode() throws java.io.IOException
UsesCodeGenerator
s to write the Java code for the generated mappings to the proper packages.- Returns:
- a list of
File
instances that were written - Throws:
java.io.IOException
-
recordCode
public java.util.List recordCode(java.util.Map<java.lang.Class<?>,java.lang.String> output) throws java.io.IOException
Write the code for the tool.- Parameters:
output
- if null, then perform the write directly to the filesystem; otherwise, populate the specified map with keys as the generatedClassMapping
and values as aString
that contains the generated code- Returns:
- a list of
File
instances that were written - Throws:
java.io.IOException
-
recordMetaData
public java.util.Collection recordMetaData(boolean perClass) throws java.io.IOException
Write the generated metadata to the proper packages.- Returns:
- the set of metadata
File
s that were written - Throws:
java.io.IOException
-
recordMetaData
public java.util.Collection recordMetaData(boolean perClass, java.util.Map output) throws java.io.IOException
Write the code for the tool.- Parameters:
output
- if null, then perform the write directly to the filesystem; otherwise, populate the specified map with keys as the generatedClassMapping
and values as aString
that contains the generated code- Returns:
- the set of metadata
File
s that were written - Throws:
java.io.IOException
-
buildAnnotations
public void buildAnnotations()
-
getAnnotationsForMeta
public java.util.List getAnnotationsForMeta(java.lang.Object meta)
Returns a list of stringified annotations for specified meta.
-
getClassMapping
public ClassMapping getClassMapping(Table table)
Return the class mapping for the given table, or null if none.
-
newClassMapping
public ClassMapping newClassMapping(java.lang.Class cls, Table table)
Create a new class to be mapped to a table. The class will start out with a default application identity class set.
-
generateClass
public java.lang.Class generateClass(java.lang.String name, java.lang.Class parent)
Generate a new class with the given name. If a non-null parent class is given, it will be set as the superclass.
-
isUnique
public boolean isUnique(ForeignKey fk)
Return whether the given foreign key is unique.
-
getUniqueForeignKey
public ForeignKey getUniqueForeignKey(Table table)
If the given table has a single unique foreign key or a foreign key that matches the primary key, return it. Else return null.
-
addJoinConstraints
public void addJoinConstraints(FieldMapping field)
Add existing unique constraints and indexes to the given field's join.
-
addConstraints
public void addConstraints(ValueMapping vm)
Add existing unique constraints and indexes to the given value.
-
isBaseTable
public boolean isBaseTable(Table table)
Return whether the given table is a base class table.
-
newFieldMapping
public FieldMapping newFieldMapping(java.lang.String name, java.lang.Class type, Column col, ForeignKey fk, ClassMapping dec)
Create a field mapping for the given info, or return null if customizer rejects.
-
getFieldName
public java.lang.String getFieldName(java.lang.String name, ClassMapping dec)
Return a default Java identifier-formatted name for the given column/table name.
-
getFieldType
public java.lang.Class getFieldType(Column col, boolean forceObject)
Return the default field type for the given column.
-
clone
public java.lang.Object clone()
Return a new tool with the same settings as this one. Used in workbench.- Overrides:
clone
in classjava.lang.Object
-
newInstance
protected static ReverseMappingTool newInstance(JDBCConfiguration conf)
-
main
public static void main(java.lang.String[] args) throws java.io.IOException, java.sql.SQLException
Usage: java org.apache.openjpa.jdbc.meta.ReverseMappingTool [option]* <.schema file or resource>* Where the following options are recognized.- -properties/-p <properties file or resource>: The
path or resource name of a OpenJPA properties file containing
information such as the license key data as outlined in
OpenJPAConfiguration
. Optional. - -<property name> <property value>: All bean
properties of the OpenJPA
JDBCConfiguration
can be set by using their names and supplying a value. For example:-licenseKey adslfja83r3lkadf
- -schemas/-s <schemas and tables>: Comma-separated list of schemas and tables to reverse-map.
- -package/-pkg <package name>: The name of the package for all generated classes. Defaults to no package.
- -directory/-d <output directory>: The directory where all generated code should be placed. Defaults to the current directory.
- -useSchemaName/-sn <true/t | false/f>: Set this flag to true to include the schema name as part of the generated class name for each table.
- -useSchemaElement/-se <true/t | false/f>: Set this flag to false to exclude the schema name from the @Table annotation in the generated class for each table. If set to false, the schema name will also be removed from the corresponding XML mapping files (orm.xml) that are generated by the tool. The initialized value is true (in order to preserve backwards compatibility).
- -useForeignKeyName/-fkn <true/t | false/f>: Set this flag to true to use the foreign key name to generate fields representing relations between classes.
- -nullableAsObject/-no <true/t | false/f>: Set to true to make all nullable columns map to object types; columns that would normally map to a primitive will map to the appropriate wrapper type instead.
- -blobAsObject/-bo <true/t | false/f>: Set to true to make all binary columns map to Object rather than byte[].
- -useGenericCollections/-gc <true/t | false/f>: Set to true to use generic collections on OneToMany and ManyToMany relations (requires JDK 1.5 or higher).
- -typeMap/-typ <types>: Default mapping of SQL type names to Java classes.
- -primaryKeyOnJoin/-pkj <true/t | false/f>: Set to true to allow primary keys on join tables.
- -useDatastoreIdentity/-ds <true/t | false/f>: Set to true to use datastore identity where possible.
- -useBuiltinIdentityClass/-bic <true/t | false/f>: Set to false to never use OpenJPA's builtin application identity classes.
- -innerIdentityClasses/-inn <true/t | false/f>: Set to true to generate the application identity classes as inner classes.
- -identityClassSuffix/-is <suffix>: Suffix to append to class names to create identity class name, or for inner identity classes, the inner class name.
- -inverseRelations/-ir <true/t | false/f>: Set to false to prevent the creation of inverse 1-many/1-1 relations for each encountered many-1/1-1 relation.
- -detachable/-det <true/t | false/f>: Set to true to make generated classes detachable.
- -discriminatorStrategy/-ds <strategy>: The default discriminator strategy to place on base classes.
- -versionStrategy/-vs <strategy>: The default version strategy to place on base classes.
- -metadata/-md <class | package | none>: Specify the level the metadata should be generated at. Defaults to generating a single package-level metadata file.
- -annotations/-ann <true/t | false/f>: Set to true to generate JPA annotations in generated code.
- -accessType/-access <field | property>: Change access type for generated annotations. Defaults to field access.
- -customizerClass/-cc <class name>: The full class
name of a
ReverseCustomizer
implementation to use to customize the reverse mapping process. Optional. - -customizerProperties/-cp <properties file or resource> : The path or resource name of a properties file that will be passed to the reverse customizer on initialization. Optional.
- -customizer/-c.<property name> < property value>
: Arguments like this will be used to configure the bean
properties of the
ReverseCustomizer
. - -codeFormat/-cf.<property name> < property value>
: Arguments like this will be used to configure the bean
properties of the internal
CodeFormat
.
- Throws:
java.io.IOException
java.sql.SQLException
- -properties/-p <properties file or resource>: The
path or resource name of a OpenJPA properties file containing
information such as the license key data as outlined in
-
run
public static boolean run(JDBCConfiguration conf, java.lang.String[] args, Options opts) throws java.io.IOException, java.sql.SQLException
Run the tool. Returns false if invalid options were given.- Throws:
java.io.IOException
java.sql.SQLException
- See Also:
main(java.lang.String[])
-
run
public static boolean run(JDBCConfiguration conf, java.lang.String[] args, Options opts, java.util.Map<java.lang.Class<?>,java.lang.String> output) throws java.io.IOException, java.sql.SQLException
Run the tool and write to the optionally provided map. Returns false if invalid options were given.- Throws:
java.io.IOException
java.sql.SQLException
- See Also:
main(java.lang.String[])
-
run
public static void run(JDBCConfiguration conf, java.lang.String[] args, ReverseMappingTool.Flags flags, java.lang.ClassLoader loader) throws java.io.IOException, java.sql.SQLException
Run the tool.- Throws:
java.io.IOException
java.sql.SQLException
-
run
public static void run(JDBCConfiguration conf, java.lang.String[] args, ReverseMappingTool.Flags flags, java.lang.ClassLoader loader, java.util.Map<java.lang.Class<?>,java.lang.String> output) throws java.io.IOException, java.sql.SQLException
Run the tool and write to the optionally provided map- Throws:
java.io.IOException
java.sql.SQLException
-
-