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 ManagedRelationship metadata, the property is backed be a foreign key column in the underlying database. Relationships are represented by ManagedRelationshipDescription.
Constructors
- ManagedEntity(ManagedDataModel dataModel, String _tableName, ClassMirror instanceType, ClassMirror persistentType)
-
Creates an instance of this type..
Properties
- attributes → Map<String, ManagedAttributeDescription>
-
read / write
- dataModel → ManagedDataModel
-
The ManagedDataModel this instance belongs to.
final - defaultProperties → List<String>
-
The list of default properties returned when querying an instance of this type.
read-only - documentedRequestSchema → APISchemaObject
-
Schema of the managed object as returned from a request to use in generating documentation.
read-only - documentedResponseSchema → APISchemaObject
-
Schema of the managed object as returned in a response to use in generating documentation.
read-only - hashCode → int
-
Derived from this'
tableName
.@override, read-only - instanceType → ClassMirror
-
The type of instances represented by this entity.
final - persistentType → ClassMirror
-
The type of persistent instances represented by this entity.
final - primaryKey → String
-
Name of primary key property.
read-only - 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 - tableName → String
-
Name of table in database this entity maps to.
read-only - 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
Operators
-
operator ==(
other) → bool -
Two entities are considered equal if they have the same tableName.
Methods
-
newInstance(
) → ManagedObject -
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