com.sun.jdo.spi.persistence.generator.database
Class DatabaseGenerator

java.lang.Object
  extended by com.sun.jdo.spi.persistence.generator.database.DatabaseGenerator

public class DatabaseGenerator
extends java.lang.Object

This class generates a database schema and a Map of mapping classes from a set of JDO classes.


Nested Class Summary
static class DatabaseGenerator.NameTuple
          This class holds three strings which contain three type of information.
 class DatabaseGenerator.Results
          Contains the results of invoking DatabaseGenerator.generate()
 
Method Summary
static DatabaseGenerator.Results generate(Model model, java.util.List pcClasses, MappingPolicy mappingPolicy, java.lang.String schemaName, java.lang.String classSuffix, boolean generateMappingClasses)
          Generate database schema and mapping model from given map of persistence class names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

generate

public static DatabaseGenerator.Results generate(Model model,
                                                 java.util.List pcClasses,
                                                 MappingPolicy mappingPolicy,
                                                 java.lang.String schemaName,
                                                 java.lang.String classSuffix,
                                                 boolean generateMappingClasses)
                                          throws org.netbeans.modules.dbschema.DBException,
                                                 java.io.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
java.io.IOException
ModelException


Copyright © 2012 GlassFish Community. All Rights Reserved.