public class SchemaTool extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SchemaTool.Mode |
Modifier and Type | Field and Description |
---|---|
static NucleusLogger |
LOGGER |
static String |
OPTION_API |
static String |
OPTION_CATALOG_NAME |
static String |
OPTION_COMPLETE_DDL |
static String |
OPTION_CREATE_DATABASE |
static String |
OPTION_CREATE_TABLES_FOR_CLASSES |
static String |
OPTION_DBINFO |
static String |
OPTION_DDL_FILE |
static String |
OPTION_DELETE_CREATE_TABLES_FOR_CLASSES |
static String |
OPTION_DELETE_DATABASE |
static String |
OPTION_DELETE_TABLES_FOR_CLASSES |
static String |
OPTION_INCLUDE_AUTO_START |
static String |
OPTION_SCHEMA_NAME |
static String |
OPTION_SCHEMAINFO |
static String |
OPTION_VALIDATE_TABLES_FOR_CLASSES |
Constructor and Description |
---|
SchemaTool()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
createDatabase(SchemaAwareStoreManager storeMgr,
String catalogName,
String schemaName) |
void |
createSchemaForClasses(SchemaAwareStoreManager storeMgr,
Set<String> classNames) |
void |
deleteDatabase(SchemaAwareStoreManager storeMgr,
String catalogName,
String schemaName) |
void |
deleteSchemaForClasses(SchemaAwareStoreManager storeMgr,
Set<String> classNames) |
String |
getApi()
Accessor for the metadata API (JDO, JPA) in use (metadata definition)
|
String |
getCatalogName() |
boolean |
getCompleteDdl() |
String |
getDdlFile() |
boolean |
getIncludeAutoStart() |
static StoreNucleusContext |
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
|
static StoreNucleusContext |
getNucleusContextForMode(SchemaTool.Mode mode,
String api,
Map userProps,
String persistenceUnitName,
String ddlFile,
boolean verbose,
boolean ignoreMetaDataForMissingClasses)
Method to create a NucleusContext for the specified mode of SchemaTool
|
Properties |
getPropertiesForSchemaTool()
Method to generate the properties to be used by SchemaTool.
|
String |
getSchemaName() |
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 |
setCatalogName(String catalogName) |
SchemaTool |
setCompleteDdl(boolean completeDdl) |
SchemaTool |
setDdlFile(String file) |
SchemaTool |
setIncludeAutoStart(boolean include) |
SchemaTool |
setSchemaName(String schemaName) |
SchemaTool |
setVerbose(boolean verbose) |
void |
validateSchemaForClasses(SchemaAwareStoreManager storeMgr,
Set<String> classNames) |
public static final NucleusLogger LOGGER
public static final String OPTION_CREATE_DATABASE
public static final String OPTION_DELETE_DATABASE
public static final String OPTION_CREATE_TABLES_FOR_CLASSES
public static final String OPTION_DELETE_TABLES_FOR_CLASSES
public static final String OPTION_DELETE_CREATE_TABLES_FOR_CLASSES
public static final String OPTION_VALIDATE_TABLES_FOR_CLASSES
public static final String OPTION_DBINFO
public static final String OPTION_SCHEMAINFO
public static final String OPTION_DDL_FILE
public static final String OPTION_COMPLETE_DDL
public static final String OPTION_INCLUDE_AUTO_START
public static final String OPTION_API
public static final String OPTION_CATALOG_NAME
public static final String OPTION_SCHEMA_NAME
public static void main(String[] args) throws Exception
args
- List of options for processing by the available methods in this class.Exception
- If an error occurs in operationpublic Properties getPropertiesForSchemaTool()
public void createDatabase(SchemaAwareStoreManager storeMgr, String catalogName, String schemaName)
public void deleteDatabase(SchemaAwareStoreManager storeMgr, String catalogName, String schemaName)
public void createSchemaForClasses(SchemaAwareStoreManager storeMgr, Set<String> classNames)
public void deleteSchemaForClasses(SchemaAwareStoreManager storeMgr, Set<String> classNames)
public void validateSchemaForClasses(SchemaAwareStoreManager storeMgr, Set<String> classNames)
public static StoreNucleusContext 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 static StoreNucleusContext getNucleusContextForMode(SchemaTool.Mode mode, String api, Map userProps, String persistenceUnitName, String ddlFile, boolean verbose, boolean ignoreMetaDataForMissingClasses)
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 modeignoreMetaDataForMissingClasses
- Whether to ignore metadata for missing classesNucleusException
- 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 getSchemaName()
public SchemaTool setSchemaName(String schemaName)
public String getCatalogName()
public SchemaTool setCatalogName(String catalogName)
public String getDdlFile()
public SchemaTool setDdlFile(String file)
public SchemaTool setCompleteDdl(boolean completeDdl)
public boolean getCompleteDdl()
public SchemaTool setIncludeAutoStart(boolean include)
public boolean getIncludeAutoStart()
Copyright © 2019. All rights reserved.