Class TableName
java.lang.Object
org.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.TableName
- All Implemented Interfaces:
Visitable
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
FieldsModifier and TypeFieldDescriptionprivate boolean(package private) String(package private) StringFields inherited from class QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX -
Constructor Summary
ConstructorsConstructorDescriptionTableName(String schemaName, String tableName, int tokBeginOffset, int tokEndOffset, ContextManager cm) Constructor for when we have both the table and schema names.TableName(String schemaName, String tableName, ContextManager cm) Constructor for when we have both the table and schema names. -
Method Summary
Modifier and TypeMethodDescription(package private) voidbind()Bind this TableName.cloneMe()Clone this TableNamebooleanCompares two TableNames.(package private) boolean2 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).(package private) boolean2 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).Get the full SQL name of this object, properly quoted and escaped.(package private) StringGet the full table name (with the schema name, if explicitly specified).Get the schema name.Get the table name (without the schema name).inthashCode()Returns a hash code for this tableName.booleanReturn true if this instance was initialized with not null schemaName.(package private) voidsetSchemaName(String schemaName) Set the schema name.toString()Convert this object to a String.Methods inherited from class QueryTreeNode
accept, acceptChildren, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generate, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, getUDTDesc, isAtomic, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, printSubNodes, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, treePrint, treePrint, verifyClassExist
-
Field Details
-
Constructor Details
-
TableName
TableName(String schemaName, String tableName, ContextManager cm) Constructor for when we have both the table and schema names.- Parameters:
schemaName- The name of the schema being referencedtableName- The name of the table or other object being referencedcm- The context manager
-
TableName
TableName(String schemaName, String tableName, int tokBeginOffset, int tokEndOffset, ContextManager cm) Constructor for when we have both the table and schema names.- Parameters:
schemaName- The name of the schema being referencedtableName- The name of the table or other object being referencedtokBeginOffset- begin position of token for the table name identifier from parser. pass in -1 if unknowntokEndOffset- end position of token for the table name identifier from parser. pass in -1 if unknowncm- The context manager
-
-
Method Details
-
getTableName
Get the table name (without the schema name).- Returns:
- Table name as a String
-
hasSchema
public boolean hasSchema()Return true if this instance was initialized with not null schemaName.- Returns:
- true if this instance was initialized with not null schemaName
-
getSchemaName
-
setSchemaName
Set the schema name.- Parameters:
schemaName- Schema name as a String
-
getFullTableName
String getFullTableName()Get the full table name (with the schema name, if explicitly specified).- Returns:
- Full table name as a String
-
getFullSQLName
Get the full SQL name of this object, properly quoted and escaped. -
toString
Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.- Overrides:
toStringin classQueryTreeNode- Returns:
- This object as a String
-
equals
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- The other TableName.- Returns:
- boolean Whether or not the 2 TableNames are equal.
-
equals
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- The other TableName.otherTableName- The other TableName.- Returns:
- boolean Whether or not the 2 TableNames are equal.
-
cloneMe
Clone this TableName -
bind
Bind this TableName. This means filling in the schema name if it wasn't specified.- Throws:
StandardException- Thrown on error
-
hashCode
-
equals
-