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 "persistent type".
class User extends ManagedObject<_User> implements _User {
String name;
}
class _User {
@primaryKey
int id;
@ManagedColumnAttributes(indexed: true)
String email;
}
Persistent types 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 persistent type 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
-
- HTTPSerializable
- Implemented by
Constructors
Properties
- backing → ManagedBacking
-
read / write
- backingMap → Map<String, dynamic>
-
The managed values of this instance.
read-only - 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
Operators
-
operator [](
String propertyName) → dynamic -
Retrieves a value by property name from the backingMap.
-
operator []=(
String propertyName, value) → void -
Sets a value by property name in the backingMap.
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
asMap(
) → Map<String, dynamic> -
Converts this instance into a serializable map.
-
hasValueForProperty(
String propertyName) → bool -
Checks whether or not a property has been set in this instances' backingMap.
-
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.
-
readMap(
Map<String, dynamic> keyValues) → void -
@Deprecated("3.0, use readFromMap instead")
-
removePropertyFromBackingMap(
String propertyName) → void -
Removes a property from the backingMap.
-
validate(
{ValidateOperation forOperation: ValidateOperation.insert, List<String> collectErrorsIn }) → bool -
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