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

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.

Parameters

Return

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

Example

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

Equals(Libraries.Language.Object object)

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

Parameters

Return

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

Example

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

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.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

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

  • boolean distinct

SetFunction(text function)

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

Parameters

  • text function

SetName(text name)

Sets the name of the column

Parameters

  • text name

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

  • boolean printTable

SetRawType(integer rawType)

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

Parameters

  • integer rawType

SetRemappedName(text remappedName)

Sets the alias

Parameters

  • text remappedName

SetTable(text table)

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

Parameters

  • text table

ToText()

returns FUNCTION ( TABLE.COLUMN ) AS REMAPPED_NAME

Return

text: