FileDocCategorySizeDatePackage
DDLTemplateFormatter.javaAPI DocGlassfish v2 API5329Fri May 04 22:34:40 BST 2007com.sun.jdo.spi.persistence.generator.database

DDLTemplateFormatter

public class DDLTemplateFormatter extends Object

Fields Summary
private static MessageFormat
createTableStart
Formatter for the start of "create table" DDL.
private static MessageFormat
alterTableAddConstraintStart
Formatter for "add constraint" DDL.
private static MessageFormat
alterTableDropConstraint
Formatter for "drop constraing" DDL.
private static MessageFormat
primaryKeyConstraint
Formatter for DDL for adding a PK constraint.
private static MessageFormat
foreignKeyConstraint
Formatter for DDL for adding an FK constraint.
private static MessageFormat
dropTable
Formatter for "drop table" DDL.
Constructors Summary
private DDLTemplateFormatter()
Prevent instantiation.


    
           
      
    
Methods Summary
static java.lang.StringformatAlterTableAddConstraint(java.lang.Object o)

returns
A String formatted for "add constraint" DDL.

        return alterTableAddConstraintStart.format(o);
    
static java.lang.StringformatAlterTableDropConstraint(java.lang.Object o)

returns
A String formatted for "drop constraint" DDL.

        return alterTableDropConstraint.format(o);
    
static java.lang.StringformatCreateTable(java.lang.Object o)

returns
A String formatted for the start of "create table" DDL.

        return createTableStart.format(o);
    
static java.lang.StringformatDropTable(java.lang.Object o)

returns
A String formatted for "drop table" DDL.

        return dropTable.format(o);
    
static java.lang.StringformatFKConstraint(java.lang.Object o)

returns
A String formatted for DDL for adding an FK constraint.

        return foreignKeyConstraint.format(o);
    
static java.lang.StringformatPKConstraint(java.lang.Object o)

returns
A String formatted for DDL for adding a PK constraint.

        return primaryKeyConstraint.format(o);
    
static voidreset(MappingPolicy mappingPolicy)
Resets MessageFormats for code generation as per policy.

param
mappingPolicy Policy that determines formatters provided by this class.

        createTableStart = new MessageFormat(
                mappingPolicy.getCreateTableStart());

        alterTableAddConstraintStart = new MessageFormat(
                mappingPolicy.getAlterTableAddConstraintStart());

        alterTableDropConstraint = new MessageFormat(
                mappingPolicy.getAlterTableDropConstraint());

        primaryKeyConstraint = new MessageFormat(
                mappingPolicy.getPrimaryKeyConstraint());

        foreignKeyConstraint = new MessageFormat(
                mappingPolicy.getForeignKeyConstraint());

        dropTable = new MessageFormat(
                mappingPolicy.getDropTable());