Libraries.Data.Database.QueryFilterConverter Documentation

This class is used to convert a filter/expression from using quorum syntax to syntax accepted by SQL.

Inherits from: Libraries.Language.Object

Summary

Actions Summary Table

ActionsDescription
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
Convert(text filter)This action takes a filter and converts it for use when converting a query to SQL.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetConversion()This returns the conversion made from calling Convert()
GetDatabaseMetaData()Returns the DatabaseMetaData which is used for checking if an expression is valid
GetFinalType()Converting an Expression will also type check it and this action is used grab what the final type is.
GetHashCode()This action gets the hash code for an object.
GetQuery()This action returns the query set for this converter.
HasConversion()If converting the expression didnt fail this will return true
SetDatabaseMetaData(Libraries.Data.Database.DatabaseMetaData meta)Sets the meta data that will be used when converting.
SetQuery(Libraries.Data.Database.Query query)This action sets the query for this converter.

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.

Convert(text filter)

This action takes a filter and converts it for use when converting a query to SQL. This action will fail if the DatabaseMetaData is not set. To grab the conversion you can check if it worked by using HasConversion() and then calling GetConversion().

Parameters

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.

GetConversion()

This returns the conversion made from calling Convert()

Return

text:

GetDatabaseMetaData()

Returns the DatabaseMetaData which is used for checking if an expression is valid

Return

Libraries.Data.Database.DatabaseMetaData:

GetFinalType()

Converting an Expression will also type check it and this action is used grab what the final type is. Used in certain queries where an expression is used in place of a column and the type needs to be known.

Return

Libraries.Language.Compile.Symbol.Type:

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.

GetQuery()

This action returns the query set for this converter. The query is used for the internal ExpressionListener since for certain cases information from the query is needed.

Return

Libraries.Data.Database.Query:

HasConversion()

If converting the expression didnt fail this will return true

Return

boolean:

SetDatabaseMetaData(Libraries.Data.Database.DatabaseMetaData meta)

Sets the meta data that will be used when converting. For example if a name is used in an expression it will be taken as a column and the meta data is used to check if that column exists

Parameters

SetQuery(Libraries.Data.Database.Query query)

This action sets the query for this converter. The query is used for the internal ExpressionListener since for certain cases information from the query is needed.

Parameters