QueryPredicate class

A predicate contains instructions for filtering rows when performing a Query.

Predicates currently are the WHERE clause in a SQL statement and are used verbatim by the PersistentStore. In general, you should use Query.where instead of using this class directly, as Query.where will use the underlying PersistentStore to generate a QueryPredicate for you.

A predicate has a format and parameters. The format is the String that comes after WHERE in a SQL query. The format may have parameterized values, for which the corresponding value is in the parameters map. A parameter is prefixed with '@' in the format string. Currently, the format string's parameter syntax is defined by the PersistentStore it is used on. An example of that format:

var predicate = new QueryPredicate("x = @xValue", {"xValue" : 5});

Constructors

QueryPredicate(String format, Map<String, dynamic> parameters)
Default constructor [...]

Properties

format String
The string format of the this predicate. [...]
read / write
parameters Map<String, dynamic>
A map of values to replace in the format string at execution time. [...]
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Static Methods

andPredicates(Iterable<QueryPredicate> predicates) QueryPredicate
Joins together a list of predicates by the 'and' token. [...]