Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

oracle.javatools.db.ddl
Class DDLType<T extends DDLType>

java.lang.Object
  extended by oracle.javatools.db.ddl.DDLType<T>
All Implemented Interfaces:
java.lang.Comparable<T>

public abstract class DDLType<T extends DDLType>
extends java.lang.Object
implements java.lang.Comparable<T>

This class must be extended for each DDLGenerator implementation that corresponds to a database type. A DDLType exists for each type of statement that can be executed against the database.

The suggestion is implementations of this class be backed by an enum for a particular database flavour. The natural ordering of the enum values should match the required ordering of the statements.

Since:
11

Constructor Summary
DDLType()
           
 
Method Summary
 java.lang.String createPrompt(DBObject obj, java.lang.String stmt)
          Creates a prompt String appropriate to the supported database's command line client (or equivalent) that can be prepended to the given statement before execution.
 boolean ensureUnique()
          If this method returns true, then when DDL objects are merged, and there are more than one of the given DDLType within the DDL only the first will be included.
abstract  java.lang.String getTerminator()
          The terminator for this type (if needed).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

DDLType

public DDLType()
Method Detail

getTerminator

public abstract java.lang.String getTerminator()
The terminator for this type (if needed).


createPrompt

public java.lang.String createPrompt(DBObject obj,
                                     java.lang.String stmt)
Creates a prompt String appropriate to the supported database's command line client (or equivalent) that can be prepended to the given statement before execution.

Parameters:
obj - the object the statement is intended for (can be null)
stmt - the statement to be executed
Returns:
a prompt String (or null if unavailable/inappropriate)

ensureUnique

public boolean ensureUnique()
If this method returns true, then when DDL objects are merged, and there are more than one of the given DDLType within the DDL only the first will be included.

Some DDL statements must only appear once, and if mutliple statements are merged commands (e.g. SPOOL commands) need to be unique.

In general this should never be true for a statement that executes for/on a specific object. It is intended only for use by appropriate "system" statements. This is in part because by ignoring all but the first occurence there is no way to ensure a given statement will be picked up when this flag is true.

Returns:
whether to ignore any but the first of this statement type when preparing the DDL for execution.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

Copyright © 1997, 2010, Oracle. All rights reserved.