Libraries.Data.Database.Support.ColumnTarget Documentation

This class is used mainly by the Find class to hold information related to the columns internal to a query. This class is used internally in the Library and is not exposed directly to the user. Typically when referencing a column the minimum needed is the name of the column and this class holds that and other information such as the table it belongs to and the type. This class also has an action that outputs the target to text for use directly in a query.

Inherits from: Libraries.Language.Object, Libraries.Data.Database.Support.RemappableName

Summary

Actions Summary Table

ActionsDescription
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetFunction()Returns the function that this column will be in.
GetHashCode()This action gets the hash code for an object.
GetName()Returns the name of the column
GetRawType()Returns the raw type of the column.
GetRemappedName()Returns the alias
GetTable()Returns the name of the table that should contain the column.
GetType()Returns a Type object corresponding to the mapping of the raw type to a Quorum type.
IsDistinct()Returns if this is a Distinct column.
SetDistinct(boolean distinct)Sets if this is a Distinct column.
SetFunction(text function)Sets the function that this column will be in.
SetName(text name)Sets the name of the column
SetPrintTable(boolean printTable)When converting this target to text the table portion is sometimes not necessary to have and can even cause issues so setting this to false will remove that portion.
SetRawType(integer rawType)Sets the raw type of the column which is calculated with the meta data given to the query.
SetRemappedName(text remappedName)Sets the alias
SetTable(text table)Sets the name of the table that should contain the column.
ToText()returns FUNCTION ( TABLE.

Actions Documentation

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Example Code

Object o
        Object t
        integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Example Code

use Libraries.Language.Object
        use Libraries.Language.Types.Text
        Object o
        Text t
        boolean result = o:Equals(t)

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

GetFunction()

Returns the function that this column will be in. Examples are SUM, AVG, and MIN.

Return

text:

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode()

Return

integer: The integer hash code of the object.

GetName()

Returns the name of the column

Return

text:

GetRawType()

Returns the raw type of the column. If -1 then the type has not been found yet. This can only be calculated with the use of meta data that is populated when the query is being generated with an active database connection.

Return

integer:

GetRemappedName()

Returns the alias

Return

text:

GetTable()

Returns the name of the table that should contain the column.

Return

text:

GetType()

Returns a Type object corresponding to the mapping of the raw type to a Quorum type. Used when type checking the target.

Return

Libraries.Language.Compile.Symbol.Type:

IsDistinct()

Returns if this is a Distinct column. Useful for Find query with distinct aggregation functions.

Return

boolean:

SetDistinct(boolean distinct)

Sets if this is a Distinct column. Useful for Find query with distinct aggregation functions.

Parameters

SetFunction(text function)

Sets the function that this column will be in. Examples are SUM, AVG, and MIN.

Parameters

SetName(text name)

Sets the name of the column

Parameters

SetPrintTable(boolean printTable)

When converting this target to text the table portion is sometimes not necessary to have and can even cause issues so setting this to false will remove that portion.

Parameters

SetRawType(integer rawType)

Sets the raw type of the column which is calculated with the meta data given to the query.

Parameters

SetRemappedName(text remappedName)

Sets the alias

Parameters

SetTable(text table)

Sets the name of the table that should contain the column.

Parameters

ToText()

returns FUNCTION ( TABLE.COLUMN ) AS REMAPPED_NAME

Return

text: