The target for database queries and coordinator of Querys.

An application that uses Aqueduct's ORM functionality must create an instance of this type. This is done in a RequestSink's constructor:

    class MyRequestSink extends RequestSink {
       MyRequestSink(ApplicationConfiguration config) : super(config) {
          var store = new PostgreSQLPersistentStore(...);
          var dataModel = new ManagedDataModel.fromCurrentMirrorSystem();
          context = new ManagedContext(dataModel, store);
       }

       ManagedContext context;
    }

A Query must have a valid ManagedContext to execute. Most applications only need one ManagedContext, so the most recently ManagedContext instantiated becomes the ManagedContext.defaultContext. By default, Querys target the ManagedContext.defaultContext and need not be specified.

Static Properties

defaultContext ManagedContext

The default context that a Query runs on.

read / write

Constructors

ManagedContext(ManagedDataModel dataModel, PersistentStore persistentStore)

Creates an instance of ManagedContext from a ManagedDataModel and PersistentStore.

ManagedContext.standalone(ManagedDataModel dataModel, PersistentStore persistentStore)

Creates an instance of ManagedContext from a ManagedDataModel and PersistentStore.

Properties

dataModel ManagedDataModel

The data model containing the ManagedEntitys that describe the ManagedObjects this instance works with.

read / write
persistentStore PersistentStore

The persistent store that Querys on this context are executed through.

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

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

entityForType(Type type) ManagedEntity

Returns an entity for a type from dataModel.

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