public class SchemaTool extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SchemaTool.Mode |
Modifier and Type | Field and Description |
---|---|
protected static Localiser |
LOCALISER
Localiser for messages.
|
static NucleusLogger |
LOGGER |
static int |
SCHEMATOOL_CREATE_MODE
create mode
|
static int |
SCHEMATOOL_DATABASE_INFO_MODE
database info mode
|
static int |
SCHEMATOOL_DELETE_MODE
delete mode
|
static int |
SCHEMATOOL_DELETECREATE_MODE
delete+create mode
|
static int |
SCHEMATOOL_SCHEMA_INFO_MODE
schema info mode
|
static int |
SCHEMATOOL_VALIDATE_MODE
validate mode
|
Constructor and Description |
---|
SchemaTool()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
createSchema(SchemaAwareStoreManager storeMgr,
Set<String> classNames) |
void |
deleteSchema(SchemaAwareStoreManager storeMgr,
Set<String> classNames) |
String |
getApi()
Acessor for the metadata API (JDO, JPA) in use (metadata definition)
|
boolean |
getCompleteDdl() |
String |
getDdlFile()
Accessor for the DDL filename
|
boolean |
getIncludeAutoStart() |
static NucleusContext |
getNucleusContextForMode(SchemaTool.Mode mode,
String api,
Map userProps,
String persistenceUnitName,
String ddlFile,
boolean verbose)
Method to create a NucleusContext for the specified mode of SchemaTool
|
Properties |
getPropertiesForSchemaTool()
Method to generate the properties to be used by SchemaTool.
|
boolean |
isVerbose() |
static void |
main(String[] args)
Entry method when invoked from the command line.
|
SchemaTool |
setApi(String api)
Mutator for the metadata API (JDO, JPA)
|
SchemaTool |
setCompleteDdl(boolean completeDdl)
Mutator for the flag to output complete DDL (when using DDL file)
|
SchemaTool |
setDdlFile(String file)
Mutator for the DDL file
|
SchemaTool |
setIncludeAutoStart(boolean include)
Mutator for the flag to include auto-start mechanisms in schema updates
|
SchemaTool |
setVerbose(boolean verbose) |
void |
validateSchema(SchemaAwareStoreManager storeMgr,
Set<String> classNames) |
protected static final Localiser LOCALISER
public static final int SCHEMATOOL_CREATE_MODE
public static final int SCHEMATOOL_DELETE_MODE
public static final int SCHEMATOOL_DELETECREATE_MODE
public static final int SCHEMATOOL_VALIDATE_MODE
public static final int SCHEMATOOL_DATABASE_INFO_MODE
public static final int SCHEMATOOL_SCHEMA_INFO_MODE
public static final NucleusLogger LOGGER
public static void main(String[] args) throws Exception
args
- List of options for processing by the available methods in this class.Exception
public Properties getPropertiesForSchemaTool()
public void createSchema(SchemaAwareStoreManager storeMgr, Set<String> classNames)
public void deleteSchema(SchemaAwareStoreManager storeMgr, Set<String> classNames)
public void validateSchema(SchemaAwareStoreManager storeMgr, Set<String> classNames)
public static NucleusContext getNucleusContextForMode(SchemaTool.Mode mode, String api, Map userProps, String persistenceUnitName, String ddlFile, boolean verbose)
mode
- Mode of operation of SchemaToolapi
- Persistence APIuserProps
- Map containing user provided properties (usually input via a file)persistenceUnitName
- Name of the persistence-unit (if any)ddlFile
- Name of a file to output DDL toverbose
- Verbose modeNucleusException
- Thrown if an error occurs in creating the required NucleusContextpublic String getApi()
public SchemaTool setApi(String api)
api
- the APIpublic boolean isVerbose()
public SchemaTool setVerbose(boolean verbose)
verbose
- the verbose to setpublic String getDdlFile()
public SchemaTool setDdlFile(String file)
file
- the file to use when outputting the DDLpublic SchemaTool setCompleteDdl(boolean completeDdl)
completeDdl
- Whether to return complete DDLpublic boolean getCompleteDdl()
public SchemaTool setIncludeAutoStart(boolean include)
include
- Whether to include the auto-start mechanism specified by persistence propspublic boolean getIncludeAutoStart()
Copyright © 2021. All rights reserved.