TableScheme class

A generic table scheme.

Constructors

TableScheme(String name, {required String? idFieldName, required Map<String, Type> fieldsTypes, Map<String, TableFieldReference> fieldsReferencedTables = const <String, TableFieldReference>{}, Iterable<TableRelationshipReference>? relationshipTables, Iterable<TableConstraint>? constraints, bool relationship = false})

Properties

constraints Set<TableConstraint>
Table constraints.
final
fieldsNames List<String>
Table fields names.
final
fieldsReferencedTables Map<String, TableFieldReference>
no setter
fieldsReferencedTablesLength int
Returns _fieldsReferencedTables length.
no setter
fieldsTypes Map<String, Type>
Fields types.
final
hashCode int
The hash code for this object.
no setterinherited
hasTableReferences bool
no setter
idFieldName String?
The ID field name.
final
name String
The table name
final
relationship bool
If true is a relationship table.
final
relationshipTables Set<TableRelationshipReference>
no setter
relationshipTablesLength int
Returns _relationshipTables length.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tableRelationshipReference Map<String, List<TableRelationshipReference>>
Returns _tableRelationshipReference.
no setter
tableRelationshipReferenceLength int
Returns _tableRelationshipReference length.
no setter

Methods

buildFieldsNamesIndexes(List<String> fieldsNames) Map<String, int>
inherited
buildFieldsNamesLC(List<String> fieldsNames) List<String>
inherited
buildFieldsNamesSimple(List<String> fieldsNames) List<String>
inherited
fieldToLCKey(String key) String
inherited
fieldToSimpleKey(String key) String
inherited
getFieldKeyInMap(String field, Map<String, Object?> map, {String? fieldLC, String? fieldSimple, Map<String, String>? mapLC, Map<String, String>? mapSimple}) String?
Returns a field key from map.
inherited
getFieldReferencedTable(String fieldKey) TableFieldReference?
Returns a TableFieldReference from _fieldsReferencedTables with a resolved fieldKey. See resolveTableFieldName.
getFieldsKeysInMap(List<String> fields, Map<String, Object?> map, {String? fieldLC, String? fieldSimple, Map<String, String>? mapLC, Map<String, String>? mapSimple}) Map<String, String?>
Returns a Map of field keys from map.
inherited
getFieldsValues(Map<String, Object?> map, {Iterable<String>? fields}) Map<String, Object?>
Returns a Map with the table fields values populated from the provided map.
getFieldsValuesFromMap(List<String> fieldsNames, Map<String, Object?> map, {Map<String, int>? fieldsNamesIndexes, List<String>? fieldsNamesLC, List<String>? fieldsNamesSimple, bool includeAbsentFields = false, List<String>? returnMapUsedKeys}) Map<String, Object?>
Returns a Map with the fields values populated from the provided map.
inherited
getFieldValueFromMap(String field, Map<String, Object?> map, {String? fieldLC, String? fieldSimple, Map<String, String>? mapLC, Map<String, String>? mapSimple}) Object?
Returns a field value from map.
inherited
getTableRelationshipReference({String? sourceTable, String? sourceField, String? targetTable}) TableRelationshipReference?
Returns the TableRelationshipReference with the targetTable.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveFiledName(List<String> fieldsNames, String fieldName, {Map<String, int>? fieldsNamesIndexes, List<String>? fieldsNamesLC, List<String>? fieldsNamesSimple, bool includeAbsentFields = false, List<String>? returnMapUsedKeys}) String?
Resolves fieldName to one that matches a fieldsNames element.
inherited
resolveTableFieldName(String key) String?
Resolves key to a matching field in fieldsNames.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited