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 {
@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://conduit.io/docs/db/modeling_data/
- Inheritance
-
- Object
- Serializable
- ManagedObject
- Implementers
Constructors
Properties
- 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
- modelFieldIncludeIfNull → bool
-
latefinal
-
properties
↔ Map<
String, ManagedPropertyDescription?> -
IMPROVEMENT: Cache of entity.properties to reduce property loading time
getter/setter pair
-
responseKeyProperties
↔ Map<
String, ManagedPropertyDescription?> -
Cache of entity.properties using ResponseKey name as key, in case no ResponseKey is set then default property name is used as key
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
asMap(
) → Map< String, dynamic> -
Converts this instance into a serializable map.
override
-
documentSchema(
APIDocumentContext context) → APISchemaObject -
Returns an
APISchemaObject
describing this object's type.override -
hasValueForProperty(
String propertyName) → bool - Checks whether or not a property has been set in this instances' backing.
-
mapKeyName(
String propertyName) → String -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
override
-
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.inherited -
readFromMap(
Map< String, dynamic> object) → void -
Reads values from
object
.override -
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.
inherited
-
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.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
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