|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.engine.DbObjectBase
public abstract class DbObjectBase
The base class for all database objects.
Field Summary | |
---|---|
protected java.lang.String |
comment
The comment (if set). |
protected Database |
database
The database. |
protected Trace |
trace
The trace module. |
Fields inherited from interface org.h2.engine.DbObject |
---|
AGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE |
Constructor Summary | |
---|---|
DbObjectBase()
|
Method Summary | |
---|---|
abstract void |
checkRename()
Check if this object can be renamed. |
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()
Build a SQL statement to re-create this object. |
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 |
Database |
getDatabase()
Get the database. |
abstract java.lang.String |
getDropSQL()
Build a SQL statement to drop this object. |
int |
getId()
Get the unique object id. |
long |
getModificationId()
Get the last modification id. |
java.lang.String |
getName()
Get the name. |
java.lang.String |
getSQL()
Get the SQL name of this object (may be quoted). |
abstract int |
getType()
Get the object type. |
protected void |
initDbObjectBase(Database db,
int objectId,
java.lang.String name,
java.lang.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(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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Database database
protected Trace trace
protected java.lang.String comment
Constructor Detail |
---|
public DbObjectBase()
Method Detail |
---|
protected void initDbObjectBase(Database db, int objectId, java.lang.String name, java.lang.String traceModule)
db
- the databaseobjectId
- the object idname
- the nametraceModule
- the trace module namepublic abstract java.lang.String getCreateSQLForCopy(Table table, java.lang.String quotedName)
getCreateSQLForCopy
in interface DbObject
table
- the new table namequotedName
- the new quoted name
public abstract java.lang.String getCreateSQL()
getCreateSQL
in interface DbObject
public abstract java.lang.String getDropSQL()
getDropSQL
in interface DbObject
public abstract int getType()
getType
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()
DbObject
setModified
in interface DbObject
public long getModificationId()
DbObject
getModificationId
in interface DbObject
protected void setObjectName(java.lang.String name)
public java.lang.String getSQL()
DbObject
getSQL
in interface DbObject
public java.util.ArrayList<DbObject> getChildren()
DbObject
getChildren
in interface DbObject
public Database getDatabase()
DbObject
getDatabase
in interface DbObject
public int getId()
DbObject
getId
in interface DbObject
public java.lang.String getName()
DbObject
getName
in interface DbObject
protected void invalidate()
public void rename(java.lang.String newName)
DbObject
rename
in interface DbObject
newName
- the new namepublic boolean isTemporary()
DbObject
isTemporary
in interface DbObject
public void setTemporary(boolean temporary)
DbObject
setTemporary
in interface DbObject
temporary
- the new valuepublic void setComment(java.lang.String comment)
DbObject
setComment
in interface DbObject
comment
- the new comment, or null for no commentpublic java.lang.String getComment()
DbObject
getComment
in interface DbObject
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |