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.
Constructors
- ManagedEntity(String _tableName, Type instanceType, String tableDefinition)
- Creates an instance of this type..
Properties
-
attributes
↔ Map<
String, ManagedAttributeDescription?> -
All attribute values of this entity.
getter/setter pair
-
defaultProperties
→ List<
String> ? -
The list of default property names of this object.
no setter
- hashCode → int
-
Derived from this' tableName.
no setteroverride
- instanceType → Type
-
The type of instances represented by this entity.
final
- name → String
-
The name of this entity.
no setter
- primaryKey ↔ String
-
Name of primary key property.
getter/setter pair
- primaryKeyAttribute → ManagedAttributeDescription?
-
no setter
-
properties
→ Map<
String, ManagedPropertyDescription?> -
All properties (relationships and attributes) of this entity.
no setter
-
relationships
↔ Map<
String, ManagedRelationshipDescription?> -
All relationship values of this entity.
getter/setter pair
- runtime → ManagedEntityRuntime
-
Set of callbacks that are implemented differently depending on compilation target.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
symbolMap
↔ Map<
Symbol, String> -
A map from accessor symbol name to property name.
getter/setter pair
- tableDefinition → String
-
The name of type of persistent instances represented by this entity.
final
- tableName → String
-
Name of table in database this entity maps to.
no setter
-
uniquePropertySet
↔ List<
ManagedPropertyDescription> ? -
Set of properties that, together, are unique for each instance of this entity.
getter/setter pair
-
validators
↔ List<
ManagedValidator> -
List of ManagedValidators for attributes of this entity.
getter/setter pair
Methods
-
document(
APIDocumentContext context) → APISchemaObject -
documentComponents(
APIDocumentContext context) → void -
Tells this object to add its components to
context
. -
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.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setOf<
T extends ManagedObject> (Iterable objects) → ManagedSet< T> ? -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
Two entities are considered equal if they have the same tableName.
override