Package org.apache.openjpa.meta
Class MetaDataTool
java.lang.Object
org.apache.openjpa.meta.MetaDataTool
- All Implemented Interfaces:
MetaDataModes
Tool for generating default metadata.
- Since:
- 0.3.0
- Author:
- Abe White
-
Nested Class Summary
-
Field Summary
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Reset state.The action supplied on construction.getFile()
The file to generate metadata to.The repository to use to hold metadata.The writer to generate metadata to.static void
Usage: java org.apache.openjpa.meta.MetaDataTool [option]* [-action/-a <add | drop>] <class name | .java file | .class file>+ Where the following options are recognized.protected MetaDataRepository
Create a new metadata repository.void
record()
Record metadata changes.void
Generate new metadata for the given class.static boolean
run
(OpenJPAConfiguration conf, String[] args, Options opts) Run the tool.static boolean
run
(OpenJPAConfiguration conf, String[] args, MetaDataTool.Flags flags, MetaDataRepository repos, ClassLoader loader) Run the tool.void
The file to generate metadata to.void
setRepository
(MetaDataRepository repos) The repository to use to hold metadata.void
The writer to generate metadata to.
-
Field Details
-
ACTION_ADD
- See Also:
-
ACTION_DROP
- See Also:
-
ACTIONS
-
-
Constructor Details
-
MetaDataTool
Constructor. Supply configuration and action.
-
-
Method Details
-
getAction
The action supplied on construction. -
getFile
The file to generate metadata to. -
setFile
The file to generate metadata to. -
getWriter
The writer to generate metadata to. -
setWriter
The writer to generate metadata to. -
getRepository
The repository to use to hold metadata. -
newRepository
Create a new metadata repository. -
setRepository
The repository to use to hold metadata. -
clear
public void clear()Reset state. This is called automatically after everyrecord()
. -
run
Generate new metadata for the given class. -
record
public void record()Record metadata changes. -
main
Usage: java org.apache.openjpa.meta.MetaDataTool [option]* [-action/-a <add | drop>] <class name | .java file | .class file>+ Where the following options are recognized.- -properties/-p <properties file or resource>: The path
or resource name of a OpenJPA properties file containing information
as outlined in
OpenJPAConfiguration
. Optional. - -<property name> <property value>: All bean
properties of the OpenJPA
OpenJPAConfiguration
can be set by using their names and supplying a value. - -file/-f <stdout | output file or resource>: The path or resource name of a file the metadata should be generated to. If the given file already contains metadata, the generated metadata will be merged into the existing document.
- add: Generate default metadata for the given classes. This is the default action.
- drop: Remove existing metadata for the given classes.
- Throws:
IOException
- -properties/-p <properties file or resource>: The path
or resource name of a OpenJPA properties file containing information
as outlined in
-
run
public static boolean run(OpenJPAConfiguration conf, String[] args, Options opts) throws IOException Run the tool. Returns false if any invalid options were given.- Throws:
IOException
-
run
public static boolean run(OpenJPAConfiguration conf, String[] args, MetaDataTool.Flags flags, MetaDataRepository repos, ClassLoader loader) throws IOException Run the tool. Return false if invalid options were given. The given repository may be null.- Throws:
IOException
-