Skip navigation links

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

E52944-01


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

java.lang.Object
  extended by oracle.javatools.db.ddl.DDL<T>


public final class DDL<T extends DDLType>
extends java.lang.Object

Class that repsents single, or multiple, statements of DDL to be executed against a database connection. Statements are kept by DDLType, so that execution can occur in the order that these statement are designed to be executed (e.g. CREATE TABLE before ALTER TABLE).

Replaces oracle.javatools.db.Ddl.

Since:
11

Constructor Summary
DDL()
          Create a new DDL object that is not associated with any one object.
DDL(DBObject obj)
          Creates a new DDL object which will contain statements to perform actions relating to the given object.

 

Method Summary
 void append(DDL<T> other)
          Appends the given DDL to this one.
 void append(T type, java.lang.String ddl)
          Appends the given ddl of specified type.
 void appendAll(T type, java.util.Collection<java.lang.String> ddl)
          Appends the given ddls of specified type.
 DDL<T> copyWithPrompts()
          Gets a copy of this DDL object with all the statements prompted as appropriate for the command line tool of the native database.
 java.util.Collection<java.lang.String> get(T type)
          Returns the statements cached for the given DDLType.
 java.util.Collection<java.lang.String> getStatements()
          Gets all of the statements in this DDL, in order of execution.
 int size()
          Returns the number of statements in this DDL.
 java.lang.String toString()
          Default toString() implementation includes terminators.
 java.lang.String toString(boolean includeTerminators)
          Converts this DDL object into one String containing all the statements.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

DDL

public DDL()
Create a new DDL object that is not associated with any one object. This is generally used as a parent when appending many statements together.

DDL

public DDL(DBObject obj)
Creates a new DDL object which will contain statements to perform actions relating to the given object. By using this constructor over the empty version, error reporting on any statements executed against the database will be able to contain the details of the object the statement was related to.

Method Detail

append

public void append(T type,
                   java.lang.String ddl)
Appends the given ddl of specified type. If statements of that type already exist in this DDL object it will be the last of them to be executed.

appendAll

public void appendAll(T type,
                      java.util.Collection<java.lang.String> ddl)
Appends the given ddls of specified type. If statements of that type already exist in this DDL object these new ddls will be executed after them.

append

public void append(DDL<T> other)
Appends the given DDL to this one.
Parameters:
other - the DDL to append to this one

get

public java.util.Collection<java.lang.String> get(T type)
Returns the statements cached for the given DDLType.
Returns:
a copy of the cached list of statements, or an empty list if there are none.

size

public int size()
Returns the number of statements in this DDL.

getStatements

public java.util.Collection<java.lang.String> getStatements()
Gets all of the statements in this DDL, in order of execution. The statements are intended for execution and are therefore not terminated.

toString

public java.lang.String toString()
Default toString() implementation includes terminators.
Overrides:
toString in class java.lang.Object
See Also:
toString(boolean)

toString

public java.lang.String toString(boolean includeTerminators)
Converts this DDL object into one String containing all the statements. The statements will be on separate lines, optionally including the necessary terminators.
Parameters:
includeTerminators - whether to include terminators
Returns:
all the DDL statements as one String

copyWithPrompts

public DDL<T> copyWithPrompts()
Gets a copy of this DDL object with all the statements prompted as appropriate for the command line tool of the native database.

Skip navigation links

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

E52944-01


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