Top Description Fields Constructors Methods
org.apache.derby.impl.sql.compile

public Class TableName

extends QueryTreeNode
Class Inheritance
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.iapi.util.IdUtil

A TableName represents a qualified name, externally represented as a schema name and an object name separated by a dot. This class is misnamed: it is used to represent the names of other object types in addition to tables.

Field Summary

Modifier and TypeField and Description
private boolean
pack-priv String
pack-priv String
Inherited from org.apache.derby.impl.sql.compile.QueryTreeNode:
AUTOINCREMENT_CREATE_MODIFYAUTOINCREMENT_CYCLEAUTOINCREMENT_INC_INDEXAUTOINCREMENT_IS_AUTOINCREMENT_INDEXAUTOINCREMENT_START_INDEX

Constructor Summary

AccessConstructor and Description
pack-priv
TableName(String
The name of the schema being referenced
schemaName
,
String
The name of the table or other object being referenced
tableName
,
ContextManager
The context manager
cm
)

Constructor for when we have both the table and schema names.

pack-priv
TableName(String
The name of the schema being referenced
schemaName
,
String
The name of the table or other object being referenced
tableName
,
int
begin position of token for the table name identifier from parser. pass in -1 if unknown
tokBeginOffset
,
int
end position of token for the table name identifier from parser. pass in -1 if unknown
tokEndOffset
,
ContextManager
The context manager
cm
)

Constructor for when we have both the table and schema names.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
bind()

Bind this TableName.

public TableName
cloneMe()

Clone this TableName

pack-priv boolean

Returns:

boolean Whether or not the 2 TableNames are equal.
equals
(TableName
The other TableName.
otherTableName
)

2 TableNames are equal if their both their schemaNames and tableNames are equal, or if this node's full table name is null (which happens when a SELECT * is expanded).

pack-priv boolean

Returns:

boolean Whether or not the 2 TableNames are equal.
equals
(String
The other TableName.
otherSchemaName
,
String
The other TableName.
otherTableName
)

2 TableNames are equal if their both their schemaNames and tableNames are equal, or if this node's full table name is null (which happens when a SELECT * is expanded).

public boolean
equals(Object
other tableName
other
)

Overrides java.lang.Object.equals.

Compares two TableNames.

public String
getFullSQLName()

Get the full SQL name of this object, properly quoted and escaped.

pack-priv String

Returns:

Full table name as a String
getFullTableName
()

Get the full table name (with the schema name, if explicitly specified).

public String

Returns:

Schema name as a String
getSchemaName
()

Get the schema name.

public String

Returns:

Table name as a String
getTableName
()

Get the table name (without the schema name).

public int

Returns:

hash code for this table name
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code for this tableName.

public boolean

Returns:

true if this instance was initialized with not null schemaName
hasSchema
()

Return true if this instance was initialized with not null schemaName.

pack-priv void
setSchemaName(String
Schema name as a String
schemaName
)

Set the schema name.

public String

Returns:

This object as a String
toString
()

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.toString.

Convert this object to a String.

Inherited from org.apache.derby.impl.sql.compile.QueryTreeNode:
acceptacceptChildrenaddTagaddUDTUsagePrivaddUDTUsagePrivbindOffsetFetchbindRowMultiSetbindUserCatalogTypebindUserTypecheckReliabilitycheckReliabilityconvertDefaultNodecopyTagsFromcreateTypeDependencydebugFlushdebugPrintdisablePrivilegeCollectionformatNodeStringgenerategenerateAuthorizeCheckgetBeginOffsetgetClassFactorygetCompilerContextgetContextgetContextManagergetDataDictionarygetDependencyManagergetEndOffsetgetExecutionFactorygetGenericConstantActionFactorygetIntPropertygetLanguageConnectionContextgetLongPropertygetNullNodegetOffsetOrderedNodesgetOptimizerFactorygetOptimizerTracergetParameterTypesgetSchemaDescriptorgetSchemaDescriptorgetStatementTypegetTableDescriptorgetTypeCompilergetUDTDescisAtomicisPrivilegeCollectionRequiredisSessionSchemaisSessionSchemamakeConstantActionmakeTableNamemakeTableNamenodeHeaderoptimizerTracingIsOnorReliabilityparseSearchConditionparseStatementprintLabelprintSubNodesreferencesSessionSchemaresolveTableToSynonymsetBeginOffsetsetEndOffsetsetRefActionInfostackPrinttaggedWithtreePrinttreePrintverifyClassExist

Field Detail

hasSchemaback to summary
private boolean hasSchema
schemaNameback to summary
pack-priv String schemaName
tableNameback to summary
pack-priv String tableName

Constructor Detail

TableNameback to summary
pack-priv TableName(String schemaName, String tableName, ContextManager cm)

Constructor for when we have both the table and schema names.

Parameters
schemaName:String

The name of the schema being referenced

tableName:String

The name of the table or other object being referenced

cm:ContextManager

The context manager

TableNameback to summary
pack-priv TableName(String schemaName, String tableName, int tokBeginOffset, int tokEndOffset, ContextManager cm)

Constructor for when we have both the table and schema names.

Parameters
schemaName:String

The name of the schema being referenced

tableName:String

The name of the table or other object being referenced

tokBeginOffset:int

begin position of token for the table name identifier from parser. pass in -1 if unknown

tokEndOffset:int

end position of token for the table name identifier from parser. pass in -1 if unknown

cm:ContextManager

The context manager

Method Detail

bindback to summary
pack-priv void bind() throws StandardException

Bind this TableName. This means filling in the schema name if it wasn't specified.

Exceptions
StandardException:
Thrown on error
cloneMeback to summary
public TableName cloneMe()

Clone this TableName

equalsback to summary
pack-priv boolean equals(TableName otherTableName)

2 TableNames are equal if their both their schemaNames and tableNames are equal, or if this node's full table name is null (which happens when a SELECT * is expanded). Also, only check table names if the schema name(s) are null.

Parameters
otherTableName:TableName

The other TableName.

Returns:boolean

boolean Whether or not the 2 TableNames are equal.

equalsback to summary
pack-priv boolean equals(String otherSchemaName, String otherTableName)

2 TableNames are equal if their both their schemaNames and tableNames are equal, or if this node's full table name is null (which happens when a SELECT * is expanded). Also, only check table names if the schema name(s) are null.

Parameters
otherSchemaName:String

The other TableName.

otherTableName:String

The other TableName.

Returns:boolean

boolean Whether or not the 2 TableNames are equal.

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Compares two TableNames. Needed for hashing logic to work.

Parameters
other:Object

other tableName

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getFullSQLNameback to summary
public String getFullSQLName()

Get the full SQL name of this object, properly quoted and escaped.

getFullTableNameback to summary
pack-priv String getFullTableName()

Get the full table name (with the schema name, if explicitly specified).

Returns:String

Full table name as a String

getSchemaNameback to summary
public String getSchemaName()

Get the schema name.

Returns:String

Schema name as a String

getTableNameback to summary
public String getTableName()

Get the table name (without the schema name).

Returns:String

Table name as a String

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code for this tableName. This allows us to use TableNames as keys in hash lists.

Returns:int

hash code for this table name

Annotations
@Override
hasSchemaback to summary
public boolean hasSchema()

Return true if this instance was initialized with not null schemaName.

Returns:boolean

true if this instance was initialized with not null schemaName

setSchemaNameback to summary
pack-priv void setSchemaName(String schemaName)

Set the schema name.

Parameters
schemaName:String

Schema name as a String

toStringback to summary
public String toString()

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.toString.

Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.

Returns:String

This object as a String

Annotations
@Override