public abstract class DbObject extends java.lang.Object implements HasSQL
Modifier and Type | Field and Description |
---|---|
static int |
AGGREGATE
This object is a user-defined aggregate function.
|
protected java.lang.String |
comment
The comment (if set).
|
static int |
COMMENT
This object is a comment.
|
static int |
CONSTANT
This object is a constant.
|
static int |
CONSTRAINT
This object is a constraint (check constraint, unique constraint, or
referential constraint).
|
protected Database |
database
The database.
|
static int |
DOMAIN
This object is a domain.
|
static int |
FUNCTION_ALIAS
This object is an alias for a Java function.
|
static int |
INDEX
This object is an index.
|
static int |
RIGHT
This object is a right.
|
static int |
ROLE
This object is a role.
|
static int |
SCHEMA
This object is a schema.
|
static int |
SEQUENCE
This object is a sequence.
|
static int |
SETTING
This object is a setting.
|
static int |
SYNONYM
This object is a synonym.
|
static int |
TABLE_OR_VIEW
The object is of the type table or view.
|
protected Trace |
trace
The trace module.
|
static int |
TRIGGER
This object is a trigger.
|
static int |
USER
This object is a user.
|
ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS
Modifier | Constructor and Description |
---|---|
protected |
DbObject(Database db,
int objectId,
java.lang.String name,
int traceModuleId)
Initialize some attributes of this object.
|
Modifier and Type | Method and Description |
---|---|
void |
checkRename()
Check if renaming is allowed.
|
java.util.ArrayList<DbObject> |
getChildren()
Get the list of dependent children (for tables, this includes indexes and
so on).
|
java.lang.String |
getComment()
Get the current comment of this object.
|
abstract java.lang.String |
getCreateSQL()
Construct the CREATE ...
|
abstract java.lang.String |
getCreateSQLForCopy(Table table,
java.lang.String quotedName)
Build a SQL statement to re-create the object, or to create a copy of the
object with a different name or referencing a different table
|
java.lang.String |
getCreateSQLForMeta()
Construct the CREATE ...
|
Database |
getDatabase()
Get the database.
|
java.lang.String |
getDropSQL()
Construct a DROP ...
|
int |
getId()
Get the unique object id.
|
long |
getModificationId() |
java.lang.String |
getName()
Get the name.
|
java.lang.String |
getSQL(int sqlFlags)
Get the SQL statement of this expression.
|
java.lang.StringBuilder |
getSQL(java.lang.StringBuilder builder,
int sqlFlags)
Appends the SQL statement of this object to the specified builder.
|
abstract int |
getType()
Get the object type.
|
protected void |
invalidate()
Set the main attributes to null to make sure the object is no longer
used.
|
boolean |
isTemporary()
Check if this object is temporary (for example, a temporary table).
|
boolean |
isValid() |
abstract void |
removeChildrenAndResources(SessionLocal session)
Delete all dependent children objects and resources of this object.
|
void |
rename(java.lang.String newName)
Rename the object.
|
void |
setComment(java.lang.String comment)
Change the comment of this object.
|
void |
setModified()
Tell the object that is was modified.
|
protected void |
setObjectName(java.lang.String name) |
void |
setTemporary(boolean temporary)
Tell this object that it is temporary or not.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getTraceSQL
public static final int TABLE_OR_VIEW
public static final int INDEX
public static final int USER
public static final int SEQUENCE
public static final int TRIGGER
public static final int CONSTRAINT
public static final int SETTING
public static final int ROLE
public static final int RIGHT
public static final int FUNCTION_ALIAS
public static final int SCHEMA
public static final int CONSTANT
public static final int DOMAIN
public static final int COMMENT
public static final int AGGREGATE
public static final int SYNONYM
protected Database database
protected Trace trace
protected java.lang.String comment
protected DbObject(Database db, int objectId, java.lang.String name, int traceModuleId)
db
- the databaseobjectId
- the object idname
- the nametraceModuleId
- the trace module idpublic final void setModified()
public final long getModificationId()
protected final void setObjectName(java.lang.String name)
public java.lang.String getSQL(int sqlFlags)
HasSQL
public java.lang.StringBuilder getSQL(java.lang.StringBuilder builder, int sqlFlags)
HasSQL
public java.util.ArrayList<DbObject> getChildren()
null
public final Database getDatabase()
public final int getId()
public final java.lang.String getName()
protected void invalidate()
public final boolean isValid()
public abstract java.lang.String getCreateSQLForCopy(Table table, java.lang.String quotedName)
table
- the new tablequotedName
- the quoted namepublic java.lang.String getCreateSQLForMeta()
public abstract java.lang.String getCreateSQL()
public java.lang.String getDropSQL()
public abstract int getType()
public abstract void removeChildrenAndResources(SessionLocal session)
session
- the sessionpublic void checkRename()
public void rename(java.lang.String newName)
newName
- the new namepublic boolean isTemporary()
public void setTemporary(boolean temporary)
temporary
- the new valuepublic void setComment(java.lang.String comment)
comment
- the new comment, or null for no commentpublic java.lang.String getComment()
public java.lang.String toString()
toString
in class java.lang.Object