Query<InstanceType extends ManagedObject> constructor
Query<InstanceType extends ManagedObject> (
- ManagedContext context, {
- InstanceType? values,
Creates a new Query.
The query will be sent to the database described by context
.
For insert or update queries, you may provide values
through this constructor
or set the field of the same name later. If set in the constructor,
InstanceType
is inferred.
Implementation
factory Query(ManagedContext context, {InstanceType? values}) {
final entity = context.dataModel!.tryEntityForType(InstanceType);
if (entity == null) {
throw ArgumentError(
"Invalid context. The data model of 'context' does not contain '$InstanceType'.",
);
}
return context.persistentStore.newQuery<InstanceType>(
context,
entity,
values: values,
);
}