Class DatabaseGenerator


  • public class DatabaseGenerator
    extends Object
    This class generates a database schema and a Map of mapping classes from a set of JDO classes.
    • Method Detail

      • generate

        public static DatabaseGenerator.Results generate​(Model model,
                                                         List pcClasses,
                                                         MappingPolicy mappingPolicy,
                                                         String schemaName,
                                                         String classSuffix,
                                                         boolean generateMappingClasses)
                                                  throws org.netbeans.modules.dbschema.DBException,
                                                         IOException,
                                                         ModelException
        Generate database schema and mapping model from given map of persistence class names. The schema is not put into the SchemaElement cache as a result of this generation. The next call to SchemaElement.forName will result in the schema being placed in the cache if it is not already there. If it is already there, it is the caller's responsibility to remove the old version if desired using SchemaElement's removeFromCache method before a SchemaElement.forName call. The generated schema is saved in outputDir.schemaName.
        Parameters:
        model - Holds java type information.
        pcClasses - A List of NameTuple objects containing persistence class name and table names.
        mappingPolicy - Determines how dbvendor and user influence generated schema.
        schemaName - Identifies the generated schema.
        classSuffix - Class name suffix that should be removed when creating table names from class names.
        generateMappingClasses - if it is true, generate mapping classes also. Currently MappingClassElement's are always generated, and the parameter's value is ignored.
        Returns:
        A DatabaseGenerator.Results instance which holds the results of generation.
        Throws:
        org.netbeans.modules.dbschema.DBException
        IOException
        ModelException