Creates a new Query.
By default, context is ManagedContext.defaultContext. The entity of this instance is found by
evaluating InstanceType in context.
Source
factory Query([ManagedContext context]) {
var ctx = context ?? ManagedContext.defaultContext;
// This is an unfortunate need because of lack of reified generics.
// Would be better if persistent stores had a method to return a Query<T> subclass
// where T was not stripped.
if (ctx.persistentStore is PostgreSQLPersistentStore) {
return new PostgresQuery<InstanceType>(ctx);
}
return null;
}