ModelProperty class
ModelProperty describes a single property of an entity.
Constructors
- ModelProperty({required IdUid id, required String name, required int type, required int flags, IdUid? indexId, String? relationField, String? relationTarget, ModelHnswParams? hnswParams, String? externalName, int? externalType, PropertyType? dartType})
- ModelProperty.create(IdUid id, String? name, int? type, {int flags = 0, String? indexId, ModelEntity? entity, String? dartFieldType, String? relationTarget, bool uidRequest = false, PropertyType? dartType})
-
ModelProperty.fromMap(Map<
String, dynamic> data, ModelEntity? entity)
Properties
- dartFieldType ↔ String
-
getter/setter pair
- dartType ↔ PropertyType?
-
The Dart-side property type from the @Property(type:) annotation.
Complements
_typewith Dart-specific type variants (e.g. dateUtc). Note: this is not always set as this enum is "incomplete", i.e. "obvious" types like string are not covered. We may want to change this in the future and use this more(?).getter/setter pair - entity ↔ ModelEntity?
-
getter/setter pair
- externalName ↔ String?
-
The optional ExternalName of this property.
getter/setter pair
- externalType ↔ int?
-
The optional ExternalType of this property.
getter/setter pair
- fieldIsNullable → bool
-
no setter
- fieldIsReadOnly ↔ bool
-
getter/setter pair
- fieldType → String
-
no setter
- flags ↔ int
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hnswParams ↔ ModelHnswParams?
-
The optional HnswIndex parameters of this property.
getter/setter pair
- id ↔ IdUid
-
getter/setter pair
- indexId ↔ IdUid?
-
getter/setter pair
- isDateUtc → bool
-
For date types, this flag indicates if the value should be treated as UTC.
Computed from dartType.
no setter
- isRelation → bool
-
no setter
- isSigned → bool
-
no setter
- name ↔ String
-
The name of the property. Except if isRelation, this is also the name of
the associated Dart field. If isRelation use relationField to get the
name of the ToOne field.
getter/setter pair
- relationField ↔ String?
-
If this isRelation, the name of the field of the ToOne.
getter/setter pair
- relationTarget ↔ String?
-
If this isRelation, the name of the entity class the ToOne targets.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type ↔ int
-
getter/setter pair
- uidRequest → bool
-
final
Methods
-
hasFlag(
int flag) → bool -
hasIndexFlag(
) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeIndex(
) → void -
toMap(
{bool forModelJson = false}) → Map< String, dynamic> - See ModelEntity.toMap for important details.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited