Class SchemaTool


  • public class SchemaTool
    extends Object
    SchemaTool providing an interface for the maintenance of schemas. These utilities include:-
    • creation of a schema/catalog in the datastore
    • deletion of a schema/catalog in the datastore
    • 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
    • Constructor Detail

      • SchemaTool

        public SchemaTool()
        Constructor
    • Method Detail

      • main

        public static void main​(String[] args)
                         throws Exception
        Entry method when invoked from the command line.
        Parameters:
        args - List of options for processing by the available methods in this class.
        Throws:
        Exception - If an error occurs in operation
      • getPropertiesForSchemaTool

        public Properties getPropertiesForSchemaTool()
        Method to generate the properties to be used by SchemaTool. This includes whether to create DDL to a file, and whether to include any auto-start mechanism
        Returns:
        The properties to use with SchemaTool.
      • getNucleusContextForMode

        public static PersistenceNucleusContext 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
        Parameters:
        mode - Mode of operation of SchemaTool
        api - Persistence API
        userProps - 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 to
        verbose - Verbose mode
        Returns:
        The NucleusContext to use
        Throws:
        NucleusException - Thrown if an error occurs in creating the required NucleusContext
      • getNucleusContextForMode

        public static PersistenceNucleusContext 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
        Parameters:
        mode - Mode of operation of SchemaTool
        api - Persistence API
        userProps - 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 to
        verbose - Verbose mode
        ignoreMetaDataForMissingClasses - Whether to ignore metadata for missing classes
        Returns:
        The NucleusContext to use
        Throws:
        NucleusException - Thrown if an error occurs in creating the required NucleusContext
      • getApi

        public String getApi()
        Accessor for the metadata API (JDO, JPA) in use (metadata definition)
        Returns:
        the API
      • setApi

        public SchemaTool setApi​(String api)
        Mutator for the metadata API (JDO, JPA)
        Parameters:
        api - the API
        Returns:
        The SchemaTool instance
      • isVerbose

        public boolean isVerbose()
        Returns:
        the verbose
      • setVerbose

        public SchemaTool setVerbose​(boolean verbose)
        Parameters:
        verbose - the verbose to set
        Returns:
        The SchemaTool instance
      • getSchemaName

        public String getSchemaName()
      • getCatalogName

        public String getCatalogName()
      • getDdlFile

        public String getDdlFile()
      • setCompleteDdl

        public SchemaTool setCompleteDdl​(boolean completeDdl)
      • getCompleteDdl

        public boolean getCompleteDdl()
      • setIncludeAutoStart

        public SchemaTool setIncludeAutoStart​(boolean include)
      • getIncludeAutoStart

        public boolean getIncludeAutoStart()