identifiedBy method

QueryExpressionJunction<T, InstanceType> identifiedBy(
  1. dynamic identifier
)

Adds an equality expression for foreign key columns to a query.

A query will only return objects where the selected object's primary key is equal to identifier.

This method may only be used on belongs-to relationships; i.e., those that have a Relate annotation. The type of identifier must match the primary key type of the selected object this expression is being applied to.

  var q = new Query<Employee>()
    ..where((e) => e.manager).identifiedBy(5);

Implementation

QueryExpressionJunction<T, InstanceType> identifiedBy(dynamic identifier) {
  expression = ComparisonExpression(identifier, PredicateOperator.equalTo);

  return _createJunction();
}