org.codehaus.mojo.openjpa
Class OpenJpaSqlMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.openjpa.AbstractOpenJpaMojo
org.codehaus.mojo.openjpa.AbstractOpenJpaMappingToolMojo
org.codehaus.mojo.openjpa.OpenJpaSqlMojo
- All Implemented Interfaces:
- org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
public class OpenJpaSqlMojo
- extends AbstractOpenJpaMappingToolMojo
Executes the SQL generation via the OpenJPA MappingTool.
- Since:
- 1.0
- Version:
- $Id$
- Author:
- Mark Struberg
- Is bound to the specified phase of the standard build lifecycle:
- process-classes
- Requires the dependencies in this specified scope:
- compile
- Is defined by the goal name:
- sql
Field Summary |
protected boolean |
modifyDatabase
Use this option to write the planned schema modifications to
the database. |
protected static String |
OPTION_SQL_ACTION
internally the options is named 'schemaAction'! |
protected static String |
OPTION_SQL_FILE
used for passing the sqlFile parameter to the mapping tool |
protected String |
sqlAction
The action to take for generating the SQL. |
protected File |
sqlFile
Use this option to write the planned schema modifications to a SQL
script. |
Fields inherited from interface org.apache.maven.plugin.Mojo |
ROLE |
Method Summary |
protected org.apache.openjpa.lib.util.Options |
getOptions()
Get the options for the various OpenJPA tools. |
Methods inherited from class org.apache.maven.plugin.AbstractMojo |
getLog, getPluginContext, setLog, setPluginContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sqlAction
protected String sqlAction
- The action to take for generating the SQL.
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)
- buildSchema (see MappingTool#ACTION_BUILD_SCHEMA)
- import (see MappingTool#ACTION_IMPORT)
- export (see MappingTool#ACTION_EXPORT)
- validate (see MappingTool#ACTION_VALIDATE)
Technically this is the same like the schemaAction
, but we have to
split it for the plugin to allow different actions for generating the mapping
and generating the SQL files.
- Is defined by:
- default-value:
- build
OPTION_SQL_ACTION
protected static final String OPTION_SQL_ACTION
- internally the options is named 'schemaAction'!
- See Also:
- Constant Field Values
sqlFile
protected File sqlFile
- Use this option to write the planned schema modifications to a SQL
script. Combine this with a schemaAction
of "build" to generate a script that recreates the schema for the
current mappings, even if the schema already exists.
- Is defined by:
- default-value:
- ${project.build.directory}/database.sql
OPTION_SQL_FILE
protected static final String OPTION_SQL_FILE
- used for passing the sqlFile parameter to the mapping tool
- See Also:
- Constant Field Values
modifyDatabase
protected boolean modifyDatabase
- Use this option to write the planned schema modifications to
the database. If this is set, the sqlFile setting (if any) will
be ignored.
- Is defined by:
- default-value:
- false
OpenJpaSqlMojo
public OpenJpaSqlMojo()
getOptions
protected org.apache.openjpa.lib.util.Options getOptions()
- Description copied from class:
AbstractOpenJpaMojo
- Get the options for the various OpenJPA tools.
- Specified by:
getOptions
in class AbstractOpenJpaMojo
- Returns:
- Options filled with all necessary plugin parameters
Copyright © 2008-2014 Codehaus. All Rights Reserved.