DVStudioModelSpec class
Where one model's records are, generated beside the model.
Constructors
-
DVStudioModelSpec({required String model, required String table, required String key, required List<
DVStudioFieldSpec> fields, bool tenantScoped = false, bool versioned = true, bool softDelete = false, DVConflict? offline, bool capture = false, String? module, DVModuleData? data, List<DVStudioIndexSpec> indexes = const <DVStudioIndexSpec>[], DVModelAccess? access, DVStudioModelOrigin origin = DVStudioModelOrigin.code}) -
const
-
DVStudioModelSpec.fromManifest(Map<
String, Object?> json) -
A spec from toManifest's output.
factory
Properties
- access → DVModelAccess?
-
Who may do what to the model's records through its data API, or null
for a model whose policies are written in code.
final
- capture → bool
-
Whether the data model declared
@DVModel(capture: true), so every write the server makes to it -- through Studio, through a device's replayed offline writes -- is recorded in the change capture log, as the model's own saves are.final - data → DVModuleData?
-
Where a module's model resolves its table and database, which depends
on how the module was mounted. Null for the application's own models.
final
-
fields
→ List<
DVStudioFieldSpec> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
The name Studio lists and addresses the model by.
no setter
-
indexes
→ List<
DVStudioIndexSpec> -
The indexes the model asks its database for, beyond its key.
final
- key → String
-
The field records are found by.
final
- model → String
-
The model's class name.
final
- module → String?
-
The mounted module the model belongs to, or null for the application's
own. Studio names it
<module>.<Model>, so a module'sOrderand the application's are two models rather than one.final - offline → DVConflict?
-
How a write this model made offline is resolved when it is replayed, or
null when it declared no
offline:at all.final - origin → DVStudioModelOrigin
-
Where the model is defined: compiled from a
@DVModel, or designed in Studio and stored beside the records it describes.final - resolvedTable → String
-
The table this model's rows are actually in, for this request.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- softDelete → bool
-
final
- table → String
-
The plain table name; the tenant's schema is resolved per request.
final
- tenantScoped → bool
-
final
- versioned → bool
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolvedDatabase(
DVDatabaseAdapter fallback) → DVDatabaseAdapter -
The database this model's rows are in, or
fallbackfor the application's own models and for a module sharing the parent's data. -
toJson(
) → Map< String, Object?> -
toManifest(
) → Map< String, Object?> - Everything a development server needs to serve this model's records without the generated code: fromManifest reads it back. The build writes the application's own models this way; a module's resolve their tables through a mount only a running backend has.
-
toString(
) → String -
A string representation of this object.
inherited
-
withOrigin(
DVStudioModelOrigin origin) → DVStudioModelSpec -
This spec, with
originsaid.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited