Class DatabaseGenerator
java.lang.Object
com.sun.jdo.spi.persistence.generator.database.DatabaseGenerator
This class generates a database schema and a Map of mapping classes from a
set of JDO classes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis class holds three strings which contain three type of information.classContains the results of invoking DatabaseGenerator.generate() -
Method Summary
Modifier and TypeMethodDescriptionstatic DatabaseGenerator.Resultsgenerate(com.sun.jdo.api.persistence.model.Model model, List pcClasses, MappingPolicy mappingPolicy, String schemaName, String classSuffix, boolean generateMappingClasses) Generate database schema and mapping model from given map of persistence class names.
-
Method Details
-
generate
public static DatabaseGenerator.Results generate(com.sun.jdo.api.persistence.model.Model model, List pcClasses, MappingPolicy mappingPolicy, String schemaName, String classSuffix, boolean generateMappingClasses) throws org.netbeans.modules.dbschema.DBException, IOException, com.sun.jdo.api.persistence.model.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.DBExceptionIOExceptioncom.sun.jdo.api.persistence.model.ModelException
-