Package org.apache.openjpa.tools.maven
Class OpenJpaSchemaMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.openjpa.tools.maven.AbstractOpenJpaMojo
-
- org.apache.openjpa.tools.maven.AbstractOpenJpaMappingToolMojo
-
- org.apache.openjpa.tools.maven.OpenJpaSchemaMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="schema", defaultPhase=PROCESS_CLASSES, requiresDependencyResolution=COMPILE, threadSafe=true) public class OpenJpaSchemaMojo extends AbstractOpenJpaMappingToolMojo
Executes the schema generation via the OpenJPA MappingTool.- Since:
- 1.0
- Version:
- $Id$
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
OPTION_SCHEMA_ACTION
used for passing the schemaAction parameter to the mapping toolprotected static java.lang.String
OPTION_SCHEMA_FILE
used for passing the schemaFile parameter to the mapping toolprotected java.lang.String
schemaAction
The action to take on the schema.protected java.io.File
schemaFile
Use this option to write the planned schema to an XML document rather than modify the database.-
Fields inherited from class org.apache.openjpa.tools.maven.AbstractOpenJpaMappingToolMojo
action, OPTION_ACTION
-
Fields inherited from class org.apache.openjpa.tools.maven.AbstractOpenJpaMojo
classes, compileClasspathElements, OPTION_CONNECTION_DRIVER_NAME, OPTION_CONNECTION_PROPERTIES, OPTION_PROPERTIES, OPTION_PROPERTIES_FILE, project, workDir
-
-
Constructor Summary
Constructors Constructor Description OpenJpaSchemaMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Options
getOptions()
Get the options for the various OpenJPA tools.-
Methods inherited from class org.apache.openjpa.tools.maven.AbstractOpenJpaMappingToolMojo
execute
-
Methods inherited from class org.apache.openjpa.tools.maven.AbstractOpenJpaMojo
createOptions, extendRealmClasspath, findEntityClassFiles, getClasspathElements, getEntityClasses, getFilePaths, skipMojo
-
-
-
-
Field Detail
-
schemaAction
@Parameter(defaultValue="add") protected java.lang.String schemaAction
The action to take on the schema. Actions can be composed in a comma-separated list of one of the following items:- add (see MappingTool#ACTION_ADD)
- refresh (see MappingTool#ACTION_REFRESH)
- drop (see MappingTool#ACTION_DROP)
- dropSchema (see MappingTool#ACTION_DROP_SCHEMA)
- buildSchema (see MappingTool#ACTION_BUILD_SCHEMA)
- import (see MappingTool#ACTION_IMPORT)
- export (see MappingTool#ACTION_EXPORT)
- validate (see MappingTool#ACTION_VALIDATE)
-
OPTION_SCHEMA_ACTION
protected static final java.lang.String OPTION_SCHEMA_ACTION
used for passing the schemaAction parameter to the mapping tool- See Also:
- Constant Field Values
-
schemaFile
@Parameter(defaultValue="${project.build.directory}/schema.xml") protected java.io.File schemaFile
Use this option to write the planned schema to an XML document rather than modify the database. The document can then be manipulated and committed to the database with the schema tool
-
OPTION_SCHEMA_FILE
protected static final java.lang.String OPTION_SCHEMA_FILE
used for passing the schemaFile parameter to the mapping tool- See Also:
- Constant Field Values
-
-
Method Detail
-
getOptions
protected Options getOptions() throws org.apache.maven.plugin.MojoExecutionException
Description copied from class:AbstractOpenJpaMojo
Get the options for the various OpenJPA tools.- Specified by:
getOptions
in classAbstractOpenJpaMojo
- Returns:
- Options filled with all necessary plugin parameters
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-