Package gudusoft.gsqlparser.sqlenv
Class TSQLObject
Object
gudusoft.gsqlparser.sqlenv.TSQLObject
- Direct Known Subclasses:
TFunctoinColumn,TSQLCatalog,TSQLColumn,TSQLParameter,TSQLSchema,TSQLSchemaObject
base class of all the database object such as catalog, schema, table, column and etc
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ESQLDataObjectTypeprotected Stringprotected Stringprotected TSQLEnv -
Constructor Summary
ConstructorsConstructorDescriptionTSQLObject(TSQLEnv sqlEnv, String objectName, ESQLDataObjectType dataObjectType) create a new database object and add to the SQL environment. -
Method Summary
Modifier and TypeMethodDescriptionstatic intcompareTo(EDbVendor dbVendor, ESQLDataObjectType sqlDataObjectType, TSQLObject targetDataObject, String objectName) static intcompareTo(EDbVendor dbVendor, ESQLDataObjectType sqlDataObjectType, String pTargetObjectName, String objectName) Deprecated.since version 2.2.3.2(2021-05-10), replaced by @TSQLEnv.compareIdentifier()static intcompareTo(TSQLEnv sqlEnv, ESQLDataObjectType sqlDataObjectType, TSQLObject targetDataObject, String objectName) how to compare the name of database object is various from different databases due to the different implementation.intcompare the name of this object to objectname with carefully handle of the case [in]sensitive.Type of this database objectgetName()name of this database object.name of this database object.qualified name for database object such as: databaseName.schemaName.tableNameSQL environment where this database object belonged to.static booleanisDelimitedIdentifier(TSQLEnv sqlEnv, String identifier) check whether a database object name is a delimited identifier or not based on the database.booleanisDelimitedIdentifier(String identifier) whether is this a delimited identifier.normalizeIdentifier(String identifier) Change the case of the name of database object.voidsetDataObjectType(ESQLDataObjectType dataObjectType)
-
Field Details
-
name
-
nameKeepCase
-
sqlEnv
-
dataObjectType
-
-
Constructor Details
-
TSQLObject
create a new database object and add to the SQL environment.- Parameters:
sqlEnv- SQL environmentobjectName- object name
-
-
Method Details
-
getSqlEnv
SQL environment where this database object belonged to.- Returns:
- SQL environment
-
getNameKeepCase
name of this database object. With the case unchanged.- Returns:
- database object name
-
getName
name of this database object. case of the name was normalized according to the database vendor's implementation. If the name was picked up from a SQL script, it's case maybe changed and not the same as it appeared in the SQL script.- Returns:
- name
-
setDataObjectType
-
getDataObjectType
Type of this database object- Returns:
- database object type
-
getQualifiedName
qualified name for database object such as: databaseName.schemaName.tableName- Returns:
- qualified name
-
isDelimitedIdentifier
whether is this a delimited identifier.- Parameters:
identifier- name of a database object- Returns:
- true if it's a delimited/quoted identifer.
-
normalizeIdentifier
Change the case of the name of database object.- Parameters:
identifier- database object name- Returns:
- normalized database object name
-
compareTo
compare the name of this object to objectname with carefully handle of the case [in]sensitive.- Parameters:
objectName- object name need to be compared- Returns:
- a negative integer, zero, or a positive integer as the specified String is greater than, equal to, or less than this object name
-
isDelimitedIdentifier
check whether a database object name is a delimited identifier or not based on the database.- Parameters:
sqlEnv- SQL environmentidentifier- database object name- Returns:
- true if it's delimited/quoted identifier
-
compareTo
public static int compareTo(TSQLEnv sqlEnv, ESQLDataObjectType sqlDataObjectType, TSQLObject targetDataObject, String objectName) how to compare the name of database object is various from different databases due to the different implementation. We need to consider the database vendor, the database object type when comparing the database object name.- Parameters:
sqlEnv- SQL environmentsqlDataObjectType- database object typetargetDataObject- instance of database object need to be comparedobjectName- database object name- Returns:
-
compareTo
public static int compareTo(EDbVendor dbVendor, ESQLDataObjectType sqlDataObjectType, TSQLObject targetDataObject, String objectName) -
compareTo
public static int compareTo(EDbVendor dbVendor, ESQLDataObjectType sqlDataObjectType, String pTargetObjectName, String objectName) Deprecated.since version 2.2.3.2(2021-05-10), replaced by @TSQLEnv.compareIdentifier()- Parameters:
dbVendor-sqlDataObjectType-pTargetObjectName-objectName-- Returns:
-