ManagedEntity class

Mapping information between a table in a database and a ManagedObject object.

An entity defines the mapping between a database table and ManagedObject subclass. Entities are created by declaring ManagedObject subclasses and instantiating a ManagedDataModel. In general, you do not need to use or create instances of this class.

An entity describes the properties that a subclass of ManagedObject will have and their representation in the underlying database. Each of these properties are represented by an instance of a ManagedPropertyDescription subclass. A property is either an attribute or a relationship.

Attribute values are scalar (see ManagedPropertyType) - int, String, DateTime, double and bool. Attributes are typically backed by a column in the underlying database for a ManagedObject, but may also represent transient values defined by the instanceType. Attributes are represented by ManagedAttributeDescription.

The value of a relationship property is a reference to another ManagedObject. If a relationship property has Relate metadata, the property is backed be a foreign key column in the underlying database. Relationships are represented by ManagedRelationshipDescription.

Implemented types

Constructors

ManagedEntity(ManagedDataModel dataModel, String _tableName, ClassMirror instanceType, ClassMirror tableDefinition)
Creates an instance of this type.. [...]

Properties

attributes ↔ Map<String, ManagedAttributeDescription>
All attribute values of this entity. [...]
read / write
dataModel ManagedDataModel
The ManagedDataModel this instance belongs to.
final
defaultProperties → List<String>
The list of default property names of this object. [...]
read-only
hashCode → int
Derived from this' tableName.
read-only
instanceType ClassMirror
The type of instances represented by this entity. [...]
final
name → String
The name of this entity. [...]
read-only
primaryKey ↔ String
Name of primary key property. [...]
read / write
primaryKeyAttribute ManagedAttributeDescription
read-only
properties → Map<String, ManagedPropertyDescription>
All properties (relationships and attributes) of this entity. [...]
read-only
relationships ↔ Map<String, ManagedRelationshipDescription>
All relationship values of this entity. [...]
read / write
symbolMap ↔ Map<Symbol, String>
A map from accessor symbol name to property name. [...]
read / write
tableDefinition ClassMirror
The type of persistent instances represented by this entity. [...]
final
tableName → String
Name of table in database this entity maps to. [...]
read-only
uniquePropertySet ↔ List<ManagedPropertyDescription>
Set of properties that, together, are unique for each instance of this entity. [...]
read / write
validators ↔ List<ManagedValidator>
List of ManagedValidators for attributes of this entity. [...]
read / write
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

document(APIDocumentContext context) APISchemaObject
documentComponents(APIDocumentContext context) → void
Tells this object to add its components to context. [...]
override
identifyAttribute<T, U extends ManagedObject>(T propertyIdentifier(U x)) ManagedAttributeDescription
Returns an attribute in this entity for a property selector. [...]
identifyProperties<T, U extends ManagedObject>(T propertiesIdentifier(U x)) → List<KeyPath>
Returns a list of properties selected by propertiesIdentifier. [...]
identifyProperty<T, U extends ManagedObject>(T propertyIdentifier(U x)) → KeyPath
Returns a property selected by propertyIdentifier. [...]
identifyRelationship<T, U extends ManagedObject>(T propertyIdentifier(U x)) ManagedRelationshipDescription
Returns a relationship in this entity for a property selector. [...]
instanceOf<T extends ManagedObject>({ManagedBacking backing }) → T
Creates a new instance of this entity's instance type. [...]
toString() → String
Returns a string representation of this object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited

Operators

operator ==(dynamic other) → bool
Two entities are considered equal if they have the same tableName.