ManagedEntity class Null safety
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.
read / write
-
defaultProperties
→ List<
String> ? -
The list of default property names of this object.
read-only
- hashCode → int
-
Derived from this' tableName.
read-onlyoverride
- instanceType → Type
-
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
- runtime → ManagedEntityRuntime?
-
Set of callbacks that are implemented differently depending on compilation target.
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
-
symbolMap
↔ Map<
Symbol, String?> -
A map from accessor symbol name to property name.
read / write
- 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.
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
ManagedValidator
s for attributes of this entity.read / write
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 non-existent 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 ==(
dynamic other) → bool -
Two entities are considered equal if they have the same tableName.
override