| |
|
| java.lang.Object org.jpox.PersistenceConfiguration org.jpox.SchemaTool
SchemaTool | public class SchemaTool extends PersistenceConfiguration (Code) | | JPOX SchemaTool providing an interface for the maintenance of schemas.
These utilities include:-
- creation of tables representing classes specified in input data
- deletion of tables representing classes specified in input data
- validation of tables representing classes specified in input data
- details about the datastore
version: $Revision: 1.95 $ |
Method Summary | |
public static void | createSchema(PersistenceManagerFactory pmf, List classNames, String ddlFilename, boolean completeDdl) | public static void | deleteSchema(PersistenceManagerFactory pmf, List classNames) Method to handle the deletion of a schema's tables.
Parameters: pmf - PersistenceManagerFactory to use when generating the schema Parameters: classNames - names of all classes whose schema is to be created throws: Exception - Thrown when either an error occurs parsing the MetaData, or the DB definition is not defined. | public String | getApi() | public boolean | getCompleteDdl() | public String | getDdlFile() | public String[] | getDefaultArgs() | protected static FileMetaData[] | getFileMetaDataForInput(MetaDataManager metaDataMgr, ClassLoaderResolver clr, boolean verbose, String persistenceUnitName, String[] inputFiles) Method to take the input for SchemaTool and returns the FileMetaData that it implies. | public String | getModeName() | protected static PersistenceManagerFactory | getPMFForMode(int mode, String api, Map userProps, String persistenceUnitName, String ddlFile, boolean verbose) | public String | getPropsFileName() Acessor for the properties file name (optional). | protected Map | initPropertySetters() Initialize the PROPERTY_SETTERS Map. | public boolean | isHelp() | public boolean | isVerbose() | public static void | main(String[] args) Entry method when invoked from the command line. | public void | setApi(String api) | public void | setCommandLineArgs(String[] args) | public void | setCompleteDdl(boolean completeDdl) | public void | setDdlFile(String file) | public void | setHelp(boolean help) | public void | setModeName(String mode) | public void | setVerbose(boolean verbose) | public static void | validateSchema(PersistenceManagerFactory pmf, List classNames) Method to handle the validation of a schema's tables.
Parameters: pmf - PersistenceManagerFactory to use when generating the schema Parameters: classNames - names of all classes whose schema is to be created throws: Exception - Thrown when either an error occurs parsing the MetaData, or the DB definition is not defined. |
SCHEMATOOL_CREATE_MODE | final public static int SCHEMATOOL_CREATE_MODE(Code) | | create mode *
|
SCHEMATOOL_DATABASE_INFO_MODE | final public static int SCHEMATOOL_DATABASE_INFO_MODE(Code) | | database info mode *
|
SCHEMATOOL_DELETE_MODE | final public static int SCHEMATOOL_DELETE_MODE(Code) | | delete mode *
|
SCHEMATOOL_OPTION_COMPLETEDDL | final public static String SCHEMATOOL_OPTION_COMPLETEDDL(Code) | | create complete DDL, not only for missing elements *
|
SCHEMATOOL_OPTION_DDLFILE | final public static String SCHEMATOOL_OPTION_DDLFILE(Code) | | Property specifying the name of a DDL file*
|
SCHEMATOOL_OPTION_DUMPDDL | final public static String SCHEMATOOL_OPTION_DUMPDDL(Code) | | Property specifying the name of a DDL file (deprecated). *
|
SCHEMATOOL_OPTION_HELP | final public static String SCHEMATOOL_OPTION_HELP(Code) | | output help for schema tool *
|
SCHEMATOOL_OPTION_MODE | final public static String SCHEMATOOL_OPTION_MODE(Code) | | schema tool mode *
|
SCHEMATOOL_OPTION_PROPERTIES_FILE | final public static String SCHEMATOOL_OPTION_PROPERTIES_FILE(Code) | | properties file for schema tool *
|
SCHEMATOOL_OPTION_VERBOSE | final public static String SCHEMATOOL_OPTION_VERBOSE(Code) | | schema tool in verbose *
|
SCHEMATOOL_SCHEMA_INFO_MODE | final public static int SCHEMATOOL_SCHEMA_INFO_MODE(Code) | | schema info mode *
|
SCHEMATOOL_VALIDATE_MODE | final public static int SCHEMATOOL_VALIDATE_MODE(Code) | | validate mode *
|
SchemaTool | public SchemaTool()(Code) | | Constructor
|
createSchema | public static void createSchema(PersistenceManagerFactory pmf, List classNames, String ddlFilename, boolean completeDdl) throws Exception(Code) | | Method to handle the creation of the schema for a set of classes
Parameters: pmf - PersistenceManagerFactory to use when generating the schema Parameters: classNames - names of all classes whose schema is to be created Parameters: ddlFilename - Name of the DDL file (optional) throws: Exception - Thrown when either an error occurs parsing the MetaData, or the DB definition is not defined. |
deleteSchema | public static void deleteSchema(PersistenceManagerFactory pmf, List classNames) throws Exception(Code) | | Method to handle the deletion of a schema's tables.
Parameters: pmf - PersistenceManagerFactory to use when generating the schema Parameters: classNames - names of all classes whose schema is to be created throws: Exception - Thrown when either an error occurs parsing the MetaData, or the DB definition is not defined. |
getApi | public String getApi()(Code) | | Acessor for the API (JDO, JPA)
the API |
getCompleteDdl | public boolean getCompleteDdl()(Code) | | whether to use complete DDL |
getDdlFile | public String getDdlFile()(Code) | | Accessor for the DDL filename
the file to use when outputing the DDL |
getDefaultArgs | public String[] getDefaultArgs()(Code) | | the defaultArgs |
getFileMetaDataForInput | protected static FileMetaData[] getFileMetaDataForInput(MetaDataManager metaDataMgr, ClassLoaderResolver clr, boolean verbose, String persistenceUnitName, String[] inputFiles)(Code) | | Method to take the input for SchemaTool and returns the FileMetaData that it implies.
The input should either be a persistence-unit name, or a set of input files.
Parameters: metaDataMgr - Manager for MetaData Parameters: clr - ClassLoader resolver Parameters: verbose - Whether to put message verbosely Parameters: persistenceUnitName - Name of the "persistence-unit" Parameters: inputFiles - Input metadata/class files The FileMetaData for the input throws: JPOXException - Thrown if error(s) occur in processing the input |
getPMFForMode | protected static PersistenceManagerFactory getPMFForMode(int mode, String api, Map userProps, String persistenceUnitName, String ddlFile, boolean verbose)(Code) | | Method to create a PersistenceManagerFactory for the specified mode of SchemaTool
Parameters: mode - Mode of operation of schematool Parameters: api - Persistence API Parameters: userProps - Map containing user provided properties (usually input via a file) Parameters: persistenceUnitName - Name of the persistence-unit (if any) Parameters: ddlFile - Name of a file to output DDL to Parameters: verbose - Verbose mode The PersistenceManagerFactory to use throws: JPOXException - Thrown if an error occurs in creating the required PMF |
getPropsFileName | public String getPropsFileName()(Code) | | Acessor for the properties file name (optional).
the props file name |
initPropertySetters | protected Map initPropertySetters()(Code) | | Initialize the PROPERTY_SETTERS Map.
The PROPERTY_SETTERS Map. |
isHelp | public boolean isHelp()(Code) | | the help |
isVerbose | public boolean isVerbose()(Code) | | the verbose |
main | public static void main(String[] args) throws Exception(Code) | | Entry method when invoked from the command line.
Parameters: args - List of options for processing by the available methods in this class. throws: Exception - |
setApi | public void setApi(String api)(Code) | | Mutator for the API (JDO, JPA)
Parameters: api - the API |
setCommandLineArgs | public void setCommandLineArgs(String[] args)(Code) | | Initialize the command line arguments
Parameters: args - Command line args |
setCompleteDdl | public void setCompleteDdl(boolean completeDdl)(Code) | | Mutator for the flag to output complete DDL (when using DDL file)
Parameters: completeDdl - Whether to return complete DDL |
setDdlFile | public void setDdlFile(String file)(Code) | | Mutator for the DDL file
Parameters: file - the file to use when outputting the DDL |
setHelp | public void setHelp(boolean help)(Code) | | Parameters: help - the help to set |
setModeName | public void setModeName(String mode)(Code) | | Parameters: mode - the mode to set |
setVerbose | public void setVerbose(boolean verbose)(Code) | | Parameters: verbose - the verbose to set |
validateSchema | public static void validateSchema(PersistenceManagerFactory pmf, List classNames) throws Exception(Code) | | Method to handle the validation of a schema's tables.
Parameters: pmf - PersistenceManagerFactory to use when generating the schema Parameters: classNames - names of all classes whose schema is to be created throws: Exception - Thrown when either an error occurs parsing the MetaData, or the DB definition is not defined. |
|
|
|