ManagedObject<T> class

An object that represents a database row.

This class must be subclassed. A subclass is declared for each table in a database. These subclasses create the data model of an application.

A managed object is declared in two parts, the subclass and its table definition.

    class User extends ManagedObject<_User> implements _User {
      String name;
    }
    class _User {
      @primaryKey
      int id;

      @Column(indexed: true)
      String email;
    }

Table definitions are plain Dart objects that represent a database table. Each property is a column in the database.

A subclass of this type must implement its table definition and use it as the type argument of ManagedObject. Properties and methods declared in the subclass (also called the 'instance type') are not stored in the database.

See more documentation on defining a data model at http://aqueduct.io/docs/db/modeling_data/

Implements
Implemented by

Constructors

ManagedObject()

Properties

backing ManagedBacking
The persistent values of this object. [...]
read / write
entity ManagedEntity
The ManagedEntity this instance is described by.
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

asMap() Map<String, dynamic>
Converts this instance into a serializable map. [...]
documentSchema(APIDocumentContext context) APISchemaObject
Returns an APISchemaObject describing this object's type. [...]
hasValueForProperty(String propertyName) bool
Checks whether or not a property has been set in this instances' backing.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
readFromMap(Map<String, dynamic> keyValues) → void
Populates the properties of a this instance from a map. [...]
removePropertyFromBackingMap(String propertyName) → void
Removes a property from backing. [...]
validate({Validating forEvent: Validating.insert }) ValidationContext
Validates an object according to its property Validate metadata. [...]
willInsert() → void
Callback to modify an object prior to inserting it with a Query. [...]
willUpdate() → void
Callback to modify an object prior to updating it with a Query. [...]
toString() String
Returns a string representation of this object.
inherited

Operators

operator [](String propertyName) → dynamic
Retrieves a value by property name from backing.
operator []=(String propertyName, dynamic value) → void
Sets a value by property name in backing.
operator ==(dynamic other) bool
The equality operator. [...]
inherited

Static Properties

shouldAutomaticallyDocument bool
Whether a subclass will automatically be registered as a schema component automatically. [...]
read-only

Static Methods

instantiateDynamic(ManagedEntity entity, { ManagedBacking backing }) ManagedObject
Creates a new instance of entity with backing.