DatabaseQueryWhere¶
Description¶
The DatabaseQueryWhere object represents a condition used in DatabaseQueryFilter objects. It allows modelling the SQL statement WHERE
in a declarative manner.
› Inherits: | Object |
---|
Properties¶
key¶
This property holds a reference to a DataObject object representing a column in the database. The values of this column are compared with value as specified in the operation property.
› Type: | DataObject |
---|---|
› Signal: | keyChanged() |
› Attributes: | Writable |
operation¶
This property holds the operation which specifies how to compare values in a database column (specified by key) with the value given in the value property.
› Type: | Operation |
---|---|
› Default: | DatabaseQueryWhere.None |
› Signal: | operationChanged() |
› Attributes: | Writable |
value¶
This property holds the value to compare with the values in a database column. It should be of the same type as the database column.
› Type: | Variant |
---|---|
› Signal: | valueChanged() |
› Attributes: | Writable |
Enumerations¶
Operation¶
This enumeration describes all supported comparison operations on a database column value.
Name | Value | Description |
---|---|---|
DatabaseQueryWhere.None |
0 |
Matches always. |
DatabaseQueryWhere.Equals |
1 |
Matches if the column value is equal to the given value. |
DatabaseQueryWhere.NotEquals |
2 |
Matches if the column value is not equal to the given value. |
DatabaseQueryWhere.GreaterThan |
3 |
Matches if the column value is greater than the given value. |
DatabaseQueryWhere.LessThan |
4 |
Matches if the column value is less than the given value. |
DatabaseQueryWhere.GreaterOrEquals |
5 |
Matches if the column value is greater or equal to the given value. |
DatabaseQueryWhere.LessOrEquals |
6 |
Matches if the column value is less or equal to the given value. |
DatabaseQueryWhere.StartsWith |
7 |
Matches if the column value starts with the given value (strings only). |
DatabaseQueryWhere.EndsWith |
8 |
Matches if the column value ends with the given value (strings only). |
DatabaseQueryWhere.Contains |
9 |
Matches if the column value contains the given value (strings only). |
DatabaseQueryWhere.IsIn |
10 |
Matches if the column value is one of the given values. |
DatabaseQueryWhere.IsNull |
11 |
Matches if the column value is null. |
DatabaseQueryWhere.IEquals |
12 |
Matches if the column value is equal to the given value (case-insensitive). |
DatabaseQueryWhere.INotEquals |
13 |
Matches if the column value is not equal to the given value (case-insensitive). |
DatabaseQueryWhere.IStartsWith |
14 |
Matches if the column value starts with the given value (strings only, case-insensitive). |
DatabaseQueryWhere.IEndsWith |
15 |
Matches if the column value ends with the given value (strings only, case-insensitive). |
DatabaseQueryWhere.IContains |
16 |
Matches if the column value contains the given value (strings only, case-insensitive). |
Example¶
See DatabaseQueryFilter example on how to use DatabaseQueryWhere.