ManagedObject<T> class abstract

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 {
      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





backing ManagedBacking
The persistent values of this object.
getter/setter pair
entity ManagedEntity
The ManagedEntity this instance is described by.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited


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 nonexistent method or property is accessed.
read(Map<String, dynamic> object, {Iterable<String>? accept, Iterable<String>? ignore, Iterable<String>? reject, Iterable<String>? require}) → void
Reads values from object, after applying filters.
readFromMap(Map<String, dynamic> object) → void
Reads values from object.
removePropertiesFromBackingMap(List<String> propertyNames) → void
Removes multiple properties from backing.
removePropertyFromBackingMap(String propertyName) → void
Removes a property from backing.
toString() String
A string representation of this object.
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.


operator ==(Object other) bool
The equality operator.
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.

Static Properties

shouldAutomaticallyDocument bool
no setter