gudusoft.gsqlparser.nodes
Class TObjectName

java.lang.Object
  extended by gudusoft.gsqlparser.nodes.TParseTreeNode
      extended by gudusoft.gsqlparser.nodes.TObjectName
All Implemented Interfaces:
Visitable

public class TObjectName
extends TParseTreeNode

An objectname specifies a database object or a variable The rules for forming the name of an object depend on the object type. Database object names may be made up of a single identifier or more than one identifier. Each identifier was represented by a TSourceToken. schemaToken, databaseToken, serverToken is quite straightforward. Meanings of objectToken is depends on objectType.


Field Summary
static int ttobjAliasName
          alias name in objectToken
static int ttobjAttribute
          attribute name is in partToken
static int ttobjColumn
          column in table, objectToken is table if specified, and partToken is column name.
static int ttobjColumnAlias
          column alias in objectToken.
static int ttobjColumnMethod
          column method like SetXY below, column method in methodToken, and colomn name in partToken.
static int ttobjConstraintName
          constraint name in objectToken
static int ttobjCursorName
          cursor name in objectToken
static int ttobjDatabaseName
          Database name in objectToken
static int ttobjDatatype
          datatype was not represented by a TObjectName object, this constant was used in source tokens that consist of TTypeName.
static int ttobjFieldName
          check TExpression.getFieldName() for more
static int ttobjFunctionName
          function name in objectToken
static int ttobjIndexName
          index name in objectToken
static int ttobjIndexType
           
static int ttobjLabelName
          label name in objectToken
static int ttobjMaterializedView
           
static int ttobjMaterializedViewName
          materialized view name in objectToken
static int ttobjMiningModel
           
static int ttobjMixed
          this type is used in TObjectNameList, when objects in TObjectNameList includes more than one type, objtype of that TObjectNameList was set to ttobjMixed.
static int ttobjNotAObject
          this is not an object, like sysdate function in oracle database
static int ttobjOperator
           
static int ttObjOracleHint
           
static int ttobjPackage
          package name in objectToken
static int ttobjParameter
          parameter name in objectToken.
static int ttobjPositionalParameters
          postgresql Positional Parameters, $1, $1[1], $1[1,10] parameter name is in partToken of $1, and parameter name is in objectToken of $1.columnName, and column name is in partToken
static int ttobjProcedureName
          procedure name in objectToken
static int ttobjPropertyName
          property name in propertyToken
static int ttobjSchemaName
          schema name in schemaToken
static int ttobjSequence
          Sequence name in objectToken
static int ttobjServerName
          server name in serverToken
static int ttobjStringConstant
          string constant in objectToken
static int ttobjTable
          table name in objectToken.
static int ttObjTableAlias
          table alias in objectToken
static int ttobjTableCTE
          table name in objectToken.
static int ttobjTablePivot
          Not used..
static int ttobjTableTemp
          table name in objectToken.
static int ttobjTableVar
          table variable in objectToken.
static int ttobjTransactionName
          Transaction name in objectToken
static int ttobjTrigger
          Trigger name in objectToken
static int ttobjTypeName
          type name in objectToken
static int ttobjUnknown
          object type can't be determined.
static int ttobjVariable
          variable name in objectToken.
static int ttobjViewName
          view name in objectToken
 
Constructor Summary
TObjectName()
           
 
Method Summary
 void accept(TParseTreeVisitor v)
           
 void attributesToPropertyToken(TObjectNameList attributes)
          used in Oracle and Teradata SQL syntax
 TSourceToken getAtsign()
           
 TObjectNameList getAttributes()
          attributes in Teradata and Oracle:
 java.lang.String getColumnNameOnly()
           
 long getColumnNo()
           
 TSourceToken getColumnToken()
           
 TSourceToken getDatabaseToken()
           
 TObjectName getDblink()
           
 TSourceToken getExclamationmark()
           
 TIndirection getIndirection()
           
 long getLineNo()
           
 ESqlClause getLocation()
          Where is this object comes from such as select list, from clause, set clause
 TSourceToken getMethodToken()
           
 java.lang.String getObjectString()
           
 TSourceToken getObjectToken()
           
 int getObjectType()
           
 java.lang.String getPartString()
           
 TSourceToken getPartToken()
           
 TSourceToken getPropertyToken()
           
 TObjectNameList getReferencedObjects()
           
 java.lang.String getSchemaString()
           
 TSourceToken getSchemaToken()
           
 TSourceToken getServerToken()
           
 TSourceToken getSortType()
          When this object is column in primary key(column,...), unique key(column,...) in sql server
 void init(java.lang.Object arg1)
          Initialize a query tree node.
 void init(java.lang.Object arg1, java.lang.Object arg2)
           
 void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
           
 void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
           
 void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5)
           
 void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6)
           
 boolean isAttributeNameInObjectName(TSourceToken leftparen, TSourceToken rightparen)
           
 boolean isSubscripts()
           
 boolean isTableDetermined()
          this property is used when getObjectType() is ttobjColumn and this column was linked to a table.
 void setAtsign(TSourceToken atsign)
           
 void setAttributes(TObjectNameList attributes)
           
 void setDblink(TObjectName dblink)
           
 void setExclamationmark(TSourceToken exclamationmark)
           
 void setIndirection(TIndirection indirection)
           
 void setLocation(ESqlClause location)
           
 void setObjectType(int objectType)
           
 void setPropertyToken(TSourceToken propertyToken)
           
 void setSortType(TSourceToken sortType)
           
 void setTableDetermined(boolean tableDetermined)
           
 void TObjectName()
           
 
Methods inherited from class gudusoft.gsqlparser.nodes.TParseTreeNode
addAllMyTokensToTokenList, doParse, getDummyTag, getEndToken, getGsqlparser, getNodeType, getStartToken, setDummyTag, setEndToken, setEndToken, setGsqlparser, setNodeType, setStartToken, setStartToken, setString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ttobjNotAObject

public static final int ttobjNotAObject
this is not an object, like sysdate function in oracle database

See Also:
Constant Field Values

ttobjUnknown

public static final int ttobjUnknown
object type can't be determined.

See Also:
Constant Field Values

ttobjColumn

public static final int ttobjColumn
column in table, objectToken is table if specified, and partToken is column name.

See Also:
Constant Field Values

ttobjColumnAlias

public static final int ttobjColumnAlias
column alias in objectToken.

See Also:
Constant Field Values

ttobjTable

public static final int ttobjTable
table name in objectToken.

See Also:
Constant Field Values

ttObjTableAlias

public static final int ttObjTableAlias
table alias in objectToken

See Also:
Constant Field Values

ttobjTableCTE

public static final int ttobjTableCTE
table name in objectToken.

See Also:
Constant Field Values

ttobjTableTemp

public static final int ttobjTableTemp
table name in objectToken.

See Also:
Constant Field Values

ttobjTablePivot

public static final int ttobjTablePivot
Not used..

See Also:
Constant Field Values

ttobjTableVar

public static final int ttobjTableVar
table variable in objectToken.

See Also:
Constant Field Values

ttobjParameter

public static final int ttobjParameter
parameter name in objectToken.

See Also:
Constant Field Values

ttobjVariable

public static final int ttobjVariable
variable name in objectToken.

See Also:
Constant Field Values

ttobjColumnMethod

public static final int ttobjColumnMethod
column method like SetXY below, column method in methodToken, and colomn name in partToken.

UPDATE Cities

SET Location.SetXY(23.5, 23.5)

See Also:
Constant Field Values

ttobjProcedureName

public static final int ttobjProcedureName
procedure name in objectToken

See Also:
Constant Field Values

ttobjFunctionName

public static final int ttobjFunctionName
function name in objectToken

See Also:
Constant Field Values

ttobjLabelName

public static final int ttobjLabelName
label name in objectToken

See Also:
Constant Field Values

ttobjIndexName

public static final int ttobjIndexName
index name in objectToken

See Also:
Constant Field Values

ttobjMaterializedViewName

public static final int ttobjMaterializedViewName
materialized view name in objectToken

See Also:
Constant Field Values

ttobjCursorName

public static final int ttobjCursorName
cursor name in objectToken

See Also:
Constant Field Values

ttobjViewName

public static final int ttobjViewName
view name in objectToken

See Also:
Constant Field Values

ttobjConstraintName

public static final int ttobjConstraintName
constraint name in objectToken

See Also:
Constant Field Values

ttobjPropertyName

public static final int ttobjPropertyName
property name in propertyToken

See Also:
Constant Field Values

ttobjTransactionName

public static final int ttobjTransactionName
Transaction name in objectToken

See Also:
Constant Field Values

ttobjDatabaseName

public static final int ttobjDatabaseName
Database name in objectToken

See Also:
Constant Field Values

ttobjStringConstant

public static final int ttobjStringConstant
string constant in objectToken

See Also:
Constant Field Values

ttobjTrigger

public static final int ttobjTrigger
Trigger name in objectToken

See Also:
Constant Field Values

ttobjAliasName

public static final int ttobjAliasName
alias name in objectToken

See Also:
Constant Field Values

ttobjAttribute

public static final int ttobjAttribute
attribute name is in partToken

See Also:
Constant Field Values

ttobjTypeName

public static final int ttobjTypeName
type name in objectToken

See Also:
Constant Field Values

ttobjPackage

public static final int ttobjPackage
package name in objectToken

See Also:
Constant Field Values

ttobjSequence

public static final int ttobjSequence
Sequence name in objectToken

See Also:
Constant Field Values

ttobjDatatype

public static final int ttobjDatatype
datatype was not represented by a TObjectName object, this constant was used in source tokens that consist of TTypeName.

See Also:
Constant Field Values

ttobjSchemaName

public static final int ttobjSchemaName
schema name in schemaToken

See Also:
Constant Field Values

ttobjServerName

public static final int ttobjServerName
server name in serverToken

See Also:
Constant Field Values

ttobjOperator

public static final int ttobjOperator
See Also:
Constant Field Values

ttobjIndexType

public static final int ttobjIndexType
See Also:
Constant Field Values

ttobjMaterializedView

public static final int ttobjMaterializedView
See Also:
Constant Field Values

ttobjMiningModel

public static final int ttobjMiningModel
See Also:
Constant Field Values

ttobjFieldName

public static final int ttobjFieldName
check TExpression.getFieldName() for more

See Also:
Constant Field Values

ttobjPositionalParameters

public static final int ttobjPositionalParameters
postgresql Positional Parameters, $1, $1[1], $1[1,10] parameter name is in partToken of $1, and parameter name is in objectToken of $1.columnName, and column name is in partToken

See Also:
Constant Field Values

ttObjOracleHint

public static final int ttObjOracleHint
See Also:
Constant Field Values

ttobjMixed

public static final int ttobjMixed
this type is used in TObjectNameList, when objects in TObjectNameList includes more than one type, objtype of that TObjectNameList was set to ttobjMixed.

See Also:
Constant Field Values
Constructor Detail

TObjectName

public TObjectName()
Method Detail

TObjectName

public void TObjectName()

isSubscripts

public boolean isSubscripts()

setIndirection

public void setIndirection(TIndirection indirection)

getIndirection

public TIndirection getIndirection()

setPropertyToken

public void setPropertyToken(TSourceToken propertyToken)

getAtsign

public TSourceToken getAtsign()

getMethodToken

public TSourceToken getMethodToken()

getPropertyToken

public TSourceToken getPropertyToken()

getServerToken

public TSourceToken getServerToken()

getExclamationmark

public TSourceToken getExclamationmark()

getDblink

public TObjectName getDblink()

getDatabaseToken

public TSourceToken getDatabaseToken()

setTableDetermined

public void setTableDetermined(boolean tableDetermined)

isTableDetermined

public boolean isTableDetermined()
this property is used when getObjectType() is ttobjColumn and this column was linked to a table.
   select
          s2.s2t1a1,
          s3.s3t1a1
   from
       (
         select *

           from subselect2table1 s2t1

       ) s2,
       (
          select *
             from  subselect3table1, subselect3table2
       ) s3
 
column s2t1a1 was linked to subselect2table1, isTableDetermined() returns true for this column.
column s3t1a1 was linked to both subselect3table1 and subselect3table2 due to lack meta information from database, isTableDetermined() returns false for this column.

Returns:

attributesToPropertyToken

public void attributesToPropertyToken(TObjectNameList attributes)
used in Oracle and Teradata SQL syntax

Teradata:

column.attribute()

column.attribute().attribute()

Parameters:
attributes -

setAttributes

public void setAttributes(TObjectNameList attributes)

getAttributes

public TObjectNameList getAttributes()
attributes in Teradata and Oracle:

Teradata:

select college.school().school_name()

Returns:

setObjectType

public void setObjectType(int objectType)

getObjectType

public int getObjectType()
Returns:
the type of database object or variable this objectname represents for.

setAtsign

public void setAtsign(TSourceToken atsign)

setDblink

public void setDblink(TObjectName dblink)

setLocation

public void setLocation(ESqlClause location)

getLocation

public ESqlClause getLocation()
Where is this object comes from such as select list, from clause, set clause

Returns:

getObjectToken

public TSourceToken getObjectToken()

getPartToken

public TSourceToken getPartToken()

getSchemaToken

public TSourceToken getSchemaToken()

getSchemaString

public java.lang.String getSchemaString()

getObjectString

public java.lang.String getObjectString()

getPartString

public java.lang.String getPartString()

setExclamationmark

public void setExclamationmark(TSourceToken exclamationmark)

init

public void init(java.lang.Object arg1)
Description copied from class: TParseTreeNode
Initialize a query tree node.

Overrides:
init in class TParseTreeNode

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2)
Overrides:
init in class TParseTreeNode

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2,
                 java.lang.Object arg3)
Overrides:
init in class TParseTreeNode

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2,
                 java.lang.Object arg3,
                 java.lang.Object arg4)
Overrides:
init in class TParseTreeNode

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2,
                 java.lang.Object arg3,
                 java.lang.Object arg4,
                 java.lang.Object arg5)
Overrides:
init in class TParseTreeNode

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2,
                 java.lang.Object arg3,
                 java.lang.Object arg4,
                 java.lang.Object arg5,
                 java.lang.Object arg6)
Overrides:
init in class TParseTreeNode

getColumnNo

public long getColumnNo()
Overrides:
getColumnNo in class TParseTreeNode

getLineNo

public long getLineNo()
Overrides:
getLineNo in class TParseTreeNode

getReferencedObjects

public TObjectNameList getReferencedObjects()

getColumnNameOnly

public java.lang.String getColumnNameOnly()

accept

public void accept(TParseTreeVisitor v)
Specified by:
accept in interface Visitable
Overrides:
accept in class TParseTreeNode

setSortType

public void setSortType(TSourceToken sortType)

getSortType

public TSourceToken getSortType()
When this object is column in primary key(column,...), unique key(column,...) in sql server

there maybe sort information like column asc, column desc

this token represents for ASC, DESC if specified.

Returns:
ASC, DESC or null

getColumnToken

public TSourceToken getColumnToken()
Returns:
source token that represents column only when getObjectType() = ttobjColumn, otherwise, null will be returned.

isAttributeNameInObjectName

public boolean isAttributeNameInObjectName(TSourceToken leftparen,
                                           TSourceToken rightparen)