Predicate methods reference
The following table lists the types of comparisons and matches you can make with methods on the query object.
Predicate method |
Parameter (Type) |
Description |
|---|---|---|
|
Gosu block that contains a list of predicate methods applied to columns in the query. |
Checks whether a value satisfies a set of predicate methods, such as |
|
|
Checks whether a value is between two values. This method supports To specify an unbounded range on the lower or upper end, pass |
|
|
Compares a column to a value. For the operation type, pass one of the following values to represent the operation type:
Pass these values without quote symbols around them. These names are values in the For the value object, you can use numeric types, String types, PolicyCenter entities, keys, or typekeys. For Example of a simple equality comparison: Example of a simple less than or equal to comparison: To compare the value to the value in another column, generate a column reference and pass that instead. You can use algebraic functions that evaluate to an expression that can be evaluated at run time to be the appropriate type. For example: Or combine a column reference and algebraic functions: |
|
|
Compares a character column to a character value while ignoring uppercase and lowercase variations. For example, if the following comparison succeeds: Both of the following comparisons also succeed: |
|
|
Compares the value for this column for each row to a list of non-null objects that you specify. If the column value for a row matches any of them, the query successfully matches that row. For example: |
|
|
Compares the value for this column for each row to a list of non-null objects that you specify. If the column value for a row matches none of them, the query successfully matches that row. For example: |
|
|
Checks whether the value in that column for each row contains a specific substring. For example, if the substring is Test the use of the contains method in a realistic environment. Using the contains method as the most restrictive predicate on a query causes a full-table scan in the database because the query cannot use an index. Warning: For a query on a large table, using contains as the most
restrictive predicate can cause an unacceptable delay to the user
interface. |
|
Gosu block that contains a list of predicate methods applied to columns in the query. |
Checks whether a value satisfies one or more predicate methods, such as |
|
|
Checks whether the value in that column for each row starts with a specific substring. For example, if the substring is Note: If you choose case-insensitive partial comparisons, Gosu generates an SQL function that depends on your PolicyCenter and database configuration to implement the comparison predicate. However, if the data model definition of the column specifies the Important: Test the use of the startsWith method in a realistic
environment. Using the startsWith method as the most
restrictive predicate on a query can cause a delay on the user interface. |
|
The arguments provide set inclusion and exclusion predicates. |
Perform a join with another table and select a subset of the data by combining tables. |
| withinDistance |
|
Checks whether a location or spatial property on a column identifies a location that is within a given number of distance units of a center or reference location. For example:
|
Predicate methods that support DBFunction arguments
The predicate methods that support a DBFunction object as the comparison value are:
- compare
- compareIgnoreCase
- between
- startsWith
- contains
- subselect
See also
