public abstract class DbObjectBase extends Object implements DbObject
Modifier and Type | Field and Description |
---|---|
protected String |
comment
The comment (if set).
|
protected Database |
database
The database.
|
protected Trace |
trace
The trace module.
|
AGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE
Constructor and Description |
---|
DbObjectBase() |
Modifier and Type | Method and Description |
---|---|
abstract void |
checkRename()
Check if this object can be renamed.
|
ArrayList<DbObject> |
getChildren()
Get the list of dependent children (for tables, this includes indexes and
so on).
|
String |
getComment()
Get the current comment of this object.
|
abstract String |
getCreateSQL()
Build a SQL statement to re-create this object.
|
Database |
getDatabase()
Get the database.
|
abstract String |
getDropSQL()
Build a SQL statement to drop this object.
|
int |
getId()
Get the unique object id.
|
long |
getModificationId() |
String |
getName()
Get the name.
|
String |
getSQL()
Get the SQL name of this object (may be quoted).
|
protected void |
initDbObjectBase(Database db,
int objectId,
String name,
String traceModule)
Initialize some attributes of this object.
|
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).
|
abstract void |
removeChildrenAndResources(Session session)
Remove all dependent objects and free all resources (files, blocks in
files) of this object.
|
void |
rename(String newName)
Rename the object.
|
void |
setComment(String comment)
Change the comment of this object.
|
void |
setModified()
Tell the object that is was modified.
|
protected void |
setObjectName(String name) |
void |
setTemporary(boolean temporary)
Tell this object that it is temporary or not.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCreateSQLForCopy, getType
protected Database database
protected Trace trace
protected String comment
protected void initDbObjectBase(Database db, int objectId, String name, String traceModule)
db
- the databaseobjectId
- the object idname
- the nametraceModule
- the trace module namepublic abstract String getCreateSQL()
getCreateSQL
in interface DbObject
public abstract String getDropSQL()
getDropSQL
in interface DbObject
public abstract void removeChildrenAndResources(Session session)
removeChildrenAndResources
in interface DbObject
session
- the sessionpublic abstract void checkRename()
checkRename
in interface DbObject
public void setModified()
public long getModificationId()
protected void setObjectName(String name)
public String getSQL()
DbObject
public ArrayList<DbObject> getChildren()
DbObject
getChildren
in interface DbObject
public Database getDatabase()
DbObject
getDatabase
in interface DbObject
public int getId()
DbObject
protected void invalidate()
public void rename(String newName)
DbObject
public boolean isTemporary()
DbObject
isTemporary
in interface DbObject
public void setTemporary(boolean temporary)
DbObject
setTemporary
in interface DbObject
temporary
- the new valuepublic void setComment(String comment)
DbObject
setComment
in interface DbObject
comment
- the new comment, or null for no commentpublic String getComment()
DbObject
getComment
in interface DbObject
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.