public abstract class DDLType<T extends DDLType>
extends java.lang.Object
implements java.lang.Comparable<T>
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.
Constructor and Description |
---|
DDLType() |
Modifier and Type | Method and Description |
---|---|
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).
|
public abstract java.lang.String getTerminator()
public java.lang.String createPrompt(DBObject obj, java.lang.String stmt)
obj
- the object the statement is intended for (can be null)stmt
- the statement to be executedpublic boolean ensureUnique()
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.